38 lines
1.5 KiB
C#
38 lines
1.5 KiB
C#
using System.Linq;
|
|
using LCU.API.Internal.RepoApi.Repos.Models;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace LCU.API.Internal.RepoApi.Repos.Extensions
|
|
{
|
|
public static class QueryableIncludeAll
|
|
{
|
|
public static IQueryable<RepoAccount> IncludeAll(this IQueryable<RepoAccount> queryable)
|
|
{
|
|
return queryable
|
|
.Include(repo => repo.Borrowers)
|
|
.Include(repo => repo.Collaterals)
|
|
.ThenInclude(collateral => collateral.RepoCompanySelections)
|
|
.Include(repo => repo.RepoStatusChanges)
|
|
.Include(repo => repo.RefundStatus)
|
|
.Include(repo => repo.SixtyPlusCollector)
|
|
;
|
|
}
|
|
|
|
public static IQueryable<AuctionAssignment> IncludeAll(this IQueryable<AuctionAssignment> queryable)
|
|
{
|
|
return queryable
|
|
.Include(auctionAssignment => auctionAssignment.Auction)
|
|
.Include(auctionAssignment => auctionAssignment.AutoIMS)
|
|
.Include(auctionAssignment => auctionAssignment.FloorPriceValuesUsed)
|
|
.ThenInclude(fpvu => fpvu.CollateralValuation)
|
|
.Include(auctionAssignment => auctionAssignment.AuctionAssignmentToCollaterals)
|
|
.ThenInclude(aa2c => aa2c.Collateral);
|
|
}
|
|
|
|
public static IQueryable<Collateral> IncludeAll(this IQueryable<Collateral> queryable)
|
|
{
|
|
return queryable.Include(collateral => collateral.RepoCompanySelections);
|
|
}
|
|
}
|
|
}
|