public Task <List <ReportFamilyResult> > Report(ReportFamilySearchParams searchParams)
        {
            var taskResult = Task.Run(() =>
            {
                using (var context = new DbContext())
                {
                    var ctx = (from msf in context.MapsSocietiesToFacilities
                               join f in context.Facilities on msf.FacilityId equals f.Id
                               join flr in context.Floors on f.Id equals flr.FacilityId
                               join fls in context.Flats on flr.Id equals fls.FloorId
                               join mffo in context.MapsFlatToFlatOwner on fls.Id equals mffo.FlatId
                               join fo in context.FlatOwners on mffo.FlatOwnerId equals fo.Id
                               join fof in context.FlatOwnerFamilies
                               .Include(s => s.Approvals)
                               .Include(s => s.Comments)
                               on fo.Id equals fof.FlatOwnerId

                               where msf.SocietyId == searchParams.SocietyId
                               select new ReportFamilyResult()
                    {
                        FlatId = fls.Id,
                        FlatName = fls.Name,
                        Id = fof.Id,
                        Name = fof.Name,
                        MobileNo = fof.MobileNo,
                        AadhaarCardNo = fof.AadhaarCardNo,
                        GenderText = fof.Gender.Text,
                        RelationshipText = fof.Relationship.Text,
                        FlatOwnerName = fof.FlatOwner.Name,
                        Deleted = fof.Deleted,
                        IsRejected = fof.IsRejected,
                        IsApproved = fof.IsApproved,
                        Approvals = fof.Approvals,
                        Comments = fof.Comments,
                    })
                              .ToList();
                    return(ctx);
                }
            });

            return(taskResult);
        }
示例#2
0
 public Task <List <ReportFamilyResult> > Report(ReportFamilySearchParams searchParams)
 {
     return(_flatOwnerFamilyRepository.Report(searchParams));
 }