diff --git a/src/Infrastructure/Data/EfRepository.cs b/src/Infrastructure/Data/EfRepository.cs index cdc84fa..b0cecfa 100644 --- a/src/Infrastructure/Data/EfRepository.cs +++ b/src/Infrastructure/Data/EfRepository.cs @@ -43,25 +43,34 @@ namespace Infrastructure.Data public IEnumerable List(ISpecification spec) { + // fetch a Queryable that includes all expression-based includes var queryableResultWithIncludes = spec.Includes .Aggregate(_dbContext.Set().AsQueryable(), (current, include) => current.Include(include)); + + // modify the IQueryable to include any string-based include statements var secondaryResult = spec.IncludeStrings .Aggregate(queryableResultWithIncludes, (current, include) => current.Include(include)); + + // return the result of the query using the specification's criteria expression return secondaryResult .Where(spec.Criteria) .AsEnumerable(); } public async Task> ListAsync(ISpecification spec) { + // fetch a Queryable that includes all expression-based includes var queryableResultWithIncludes = spec.Includes .Aggregate(_dbContext.Set().AsQueryable(), (current, include) => current.Include(include)); + + // modify the IQueryable to include any string-based include statements var secondaryResult = spec.IncludeStrings .Aggregate(queryableResultWithIncludes, (current, include) => current.Include(include)); + // return the result of the query using the specification's criteria expression return await secondaryResult .Where(spec.Criteria) .ToListAsync(); diff --git a/src/Web/Views/Shared/_Layout.cshtml b/src/Web/Views/Shared/_Layout.cshtml index 998deb2..8803d10 100644 --- a/src/Web/Views/Shared/_Layout.cshtml +++ b/src/Web/Views/Shared/_Layout.cshtml @@ -33,8 +33,6 @@ @await Html.PartialAsync("_LoginPartial") -
Basket
-