Added lazy loading and fixed private properties not deserializing

This commit is contained in:
2019-05-01 10:13:05 -05:00
parent ad26b5ef00
commit 1657510d1a
10 changed files with 28 additions and 27 deletions

View File

@@ -7,6 +7,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.2.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.2.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="2.2.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.4" />
</ItemGroup>

View File

@@ -10,6 +10,7 @@ using System.Threading.Tasks;
namespace BrightGlimmer.Data.Repositories
{
/* TODO: REMOVE MAYBE? */
public class StudentQueryRepository : QueryRepository<Student>
{
public StudentQueryRepository(BgContext context) : base(context) { }
@@ -34,9 +35,9 @@ namespace BrightGlimmer.Data.Repositories
public override async Task<Student> GetAsync(Guid id)
{
return await context.Students
.Include(x => x.Phones)
.Include(x => x.Address)
.Include(x => x.AssignedCourses)
//.Include(x => x.Phones)
//.Include(x => x.Address)
//.Include(x => x.AssignedCourses)
.SingleAsync(x => x.Id == id);
}
}

Binary file not shown.