diff --git a/ServerCore/Pages/Swag/Report.cshtml b/ServerCore/Pages/Swag/Report.cshtml index 709067b3..435ce0bf 100644 --- a/ServerCore/Pages/Swag/Report.cshtml +++ b/ServerCore/Pages/Swag/Report.cshtml @@ -19,6 +19,9 @@ @Html.DisplayNameFor(model => model.SwagViews[0].PlayerName) + + @Html.DisplayNameFor(model => model.SwagViews[0].PlayerEmail) + @Html.DisplayNameFor(model => model.SwagViews[0].Lunch) @@ -40,6 +43,9 @@ @Html.DisplayFor(model => item.PlayerName) + + @Html.DisplayFor(model => item.PlayerEmail) + @Html.DisplayFor(model => item.Lunch) diff --git a/ServerCore/Pages/Swag/Report.cshtml.cs b/ServerCore/Pages/Swag/Report.cshtml.cs index 2bd13899..d673a196 100644 --- a/ServerCore/Pages/Swag/Report.cshtml.cs +++ b/ServerCore/Pages/Swag/Report.cshtml.cs @@ -26,6 +26,7 @@ public SwagReportModel(PuzzleServerContext serverContext, UserManager OnGetAsync(int? puzzleId) { - SwagViews = await (from s in _context.Swag - join t in _context.TeamMembers on s.PlayerId equals t.Member.ID - where s.Event == Event && t.Team.Event == Event - orderby t.Team.Name, s.ShirtSize - select new SwagView() - { - PlayerName = t.Member.Name, - TeamName = t.Team.Name, - Lunch = s.Lunch, - LunchModifications = s.LunchModifications, - ShirtSize = s.ShirtSize - }).ToListAsync(); + SwagViews = await (from t in _context.TeamMembers + join s in _context.Swag on t.Member.ID equals s.PlayerId into tmp + from swagState in tmp.DefaultIfEmpty() + where (swagState == null || swagState.Event == Event) && t.Team.Event == Event + orderby t.Team.Name, swagState.ShirtSize + select new SwagView() + { + PlayerName = t.Member.Name, + PlayerEmail = t.Member.Email, + TeamName = t.Team.Name, + Lunch = swagState == null ? null : swagState.Lunch, + LunchModifications = swagState == null ? null : swagState.LunchModifications, + ShirtSize = swagState == null ? null : swagState.ShirtSize + }).ToListAsync(); return Page(); } }