From 3f6bb38788506682efa8d83c6ac17a883f8784c3 Mon Sep 17 00:00:00 2001 From: Ryan Peters Date: Sat, 8 Apr 2023 10:21:33 -0400 Subject: [PATCH] load up a match --- Controllers/HomeController.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Controllers/HomeController.cs b/Controllers/HomeController.cs index 3458b01..96c327f 100644 --- a/Controllers/HomeController.cs +++ b/Controllers/HomeController.cs @@ -1,6 +1,7 @@ using System.Diagnostics; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; using Sequence.Entities; using Sequence.Models; @@ -27,13 +28,18 @@ public class HomeController : Controller var userId = Guid.Parse("08db379a-5de8-420d-8232-1bb60fdf249b"); var match = dbContext.Matches + .Include(m => m.Deck) + .Include(m => m.PlayerOne) + .ThenInclude(p => p.HandCards) + .Include(m => m.PlayerTwo) + .ThenInclude(p => p.HandCards) .OrderByDescending(m => m.Created) + .AsSplitQuery() .FirstOrDefault(m => m.PlayerOne.UserId == userId || m.PlayerTwo.UserId == userId); - if (match != null) - { - - } + + + return View(); } public async Task CreateMatch(Guid userOneGuid, Guid userTwoGuid)