public async Task <List <RealEstateViewDTO> > GetRealEstateViewList(
            List <RealEstateDTO> realestateList, List <AddressViewDTO> addressList)
        {
            List <RealEstateViewDTO>  listRealEstateView  = new List <RealEstateViewDTO>();
            List <RealEstateClassDTO> listRealEstateClass = await ClassService.GetAllRealEstateClassesAsync();

            List <RealEstateStatusDTO> listRealEstateStatus = await StatusService.GetAllRealEstateStatusesAsync();

            List <RealEstateTypeDTO> listRealEstateType = await TypeService.GetAllRealEstateTypesAsync();

            List <RealEstateTypeWallDTO> listRealEstateTypeWall = await TypeWallRealEstate.GetAllRealEstateTypeWallsAsync();

            realestateList = await this.GetAllRealEstatesAsync();

            addressList = await AddressService.GetAllAddressesViewAsync();

            Parallel.ForEach(realestateList, item =>
            {
                if (addressList.Where(a => a.Address.AddressID == item.AddressID).AsParallel().Count() != 0)
                {
                    listRealEstateView.Add(
                        new RealEstateViewDTO
                    {
                        RealEstate         = item,
                        RealEstateClass    = listRealEstateClass.Find(x => x.RealEstateClassID == item.RealEstateClassID),
                        RealEstateStatus   = listRealEstateStatus.Find(x => x.RealEstateStatusID == item.RealEstateStatusID),
                        RealEstateType     = listRealEstateType.Find(x => x.RealEstateTypeID == item.RealEstateTypeID),
                        RealEstateTypeWall = listRealEstateTypeWall.Find(x => x.RealEstateTypeWallID == item.RealEstateTypeWallID),
                        AddressView        = addressList.Find(a => a.Address.AddressID == item.AddressID)
                    }
                        );
                }
            });
            return(listRealEstateView);
        }
Example #2
0
 public async Task <List <RealEstateTypeWallDTO> > GetAllTypeWalls()
 {
     return(await realEstateTypeWallService.GetAllRealEstateTypeWallsAsync());
 }