Skip to content

Commit

Permalink
Include missing entities in GetAllAsQueryable for paginated data retr…
Browse files Browse the repository at this point in the history
…ieval
  • Loading branch information
viktorkombov committed Jan 31, 2025
1 parent 7b139c8 commit d381740
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion NorthwindCRUD/Services/CustomerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ public CustomerDb[] GetAll()

public IQueryable<CustomerDb> GetAllAsQueryable()
{
return this.dataContext.Customers;
return this.dataContext.Customers
.Include(c => c.Address);
}

public CustomerDb? GetById(string id)
Expand Down
3 changes: 2 additions & 1 deletion NorthwindCRUD/Services/EmployeeService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ public EmployeeDb[] GetAll()

public IQueryable<EmployeeDb> GetAllAsQueryable()
{
return this.dataContext.Employees;
return this.dataContext.Employees
.Include(c => c.Address);
}

public EmployeeDb? GetById(int id)
Expand Down
3 changes: 2 additions & 1 deletion NorthwindCRUD/Services/OrderService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ public OrderDb[] GetAll()

public IQueryable<OrderDb> GetAllAsQueryable()
{
return this.dataContext.Orders;
return this.dataContext.Orders
.Include(c => c.ShipAddress);
}

public OrderDb[] GetNOrders(int numberOfOrdersToRetrieve)
Expand Down

0 comments on commit d381740

Please sign in to comment.