var query = this.practicesDbContext.ServiceTransactionToClaims .Include(x => x.ClaimEntity) .ThenInclude(x => x.Carrier) .Include(x => x.ServiceTransaction) .ThenInclude(x => x.PersonAccountMember) .ThenInclude(x => x.PatientProfile) .ThenInclude(x => x.Location) .Include(x => x.ServiceTransaction) .ThenInclude(x => x.PersonAccountMember) .ThenInclude(x => x.PatientProfile) .ThenInclude(x => x.PatientBenefitPlans.Where(y => y.IsDeleted == false)) .ThenInclude(x => x.BenefitPlan) .Include(x => x.ServiceTransaction) .ThenInclude(x => x.CreditTransactionDetails) .ThenInclude(x => x.CreditTransaction)
SELECT * FROM [ServiceTransactionToClaim] AS [s] INNER JOIN [ClaimEntity] AS [c] ON [s].[ClaimId] = [c].[EntityId] INNER JOIN [ServiceTransaction] AS [s0] ON [s].[ServiceTransactionId] = [s0].[EntityId] INNER JOIN [PersonAccountMember] AS [p] ON [s0].[AccountMemberId] = [p].[EntityId] INNER JOIN [PatientProfile] AS [p0] ON [p].[PersonId] = [p0].[EntityId] LEFT JOIN [Carrier] AS [c1] ON [c].[CarrierId] = [c1].[EntityId] LEFT JOIN [Location] AS [l] ON [p0].[PreferredLocation] = [l].[EntityId]
public class PatientProfile : BaseEntity<guid> { public List<patientbenefitplan> PatientBenefitPlans { get; set; } public List<patientgroup> PatientGroups { get; set; } public List<patientphoneinfo> PatientPhoneInfos { get; set; } public List<personaccountmember> PersonAccountMembers { get; set; } public List<personaccountmember> ResponsiblePersonAccountMembers { get; set; } } public class PatientBenefitPlan : BaseEntity<guid> { public Guid BenefitPlanId { get; set; } public Guid BenefitPlanDto { get; set; } public BenefitPlan BenefitPlan { get; set; } public bool DependentChildOnly { get; set; } public DateTime? EffectiveDate { get; set; } public bool? EligibleEPSDTTitleXIX { get; set; } public decimal IndividualDeductibleUsed { get; set; } public decimal IndividualMaxUsed { get; set; } public bool IsDeleted { get; set; } public Guid PatientId { get; set; } public Guid PolicyHolderId { get; set; } public Guid PolicyHolderBenefitPlanId { get; set; } public string PolicyHolderStringId { get; set; } public int Priority { get; set; } public PatientProfile PatientProfile { get; set; } public string RelationshipToPolicyHolder { get; set; } }
PatientBenefitPlans
.Select(...)
ThenInclude
Location
PatientBenefitPlan
PatientProfile
CreditTransactionDetails
BenefitPlan
ServiceTransaction
Include
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)