示例#1
0
        //public List<string> Videos { get; set; }

        public AdItemOnmapDbModel FromDomain(AdItemOnmapDomainModel item)
        {
            AdItemId       = item.Id;
            DateCreate     = item.DateCreate;
            DateUpdate     = item.DateUpdate;
            EnCity         = item.EnCity;
            EnHouseNumber  = item.EnHouseNumber;
            EnNeighborhood = item.EnNeighborhood;
            EnStreetName   = item.EnStreetName;
            HeCity         = item.HeCity;
            HeHouseNumber  = item.HeHouseNumber;
            HeNeighborhood = item.HeNeighborhood;
            HeStreetName   = item.HeStreetName;
            Latitude       = (double)item.Latitude.ConvertToDouble();
            Longitude      = (double)item.Longitude.ConvertToDouble();
            AriaBase       = item.AriaBase.ConvertToFloat();
            Balconies      = item.Balconies.ConvertToInt();
            Bathrooms      = item.Bathrooms;
            Elevators      = item.Elevators;
            FloorOn        = item.FloorOn.ConvertToInt();
            FloorOf        = item.FloorOf.ConvertToInt();
            Rooms          = item.Rooms.ConvertToInt();
            Toilets        = item.Toilets;
            ContactEmail   = item.ContactEmail;
            ContactName    = item.ContactName;
            ContactPhone   = item.ContactPhone;
            Description    = item.Description;
            Price          = item.Price.ConvertToFloat();
            PropertyType   = item.PropertyType;
            Section        = item.Section;
            Images         = item.Images.Select(x => x.Full).ToList();
            //Videos = item.Videos.Select(x => x.Source).ToList();

            return(this);
        }
        public AdItemOnmapExcelModel FromDomain(AdItemOnmapDomainModel item)
        {
            ItemId         = item.Id;
            DateCreate     = item.DateCreate;
            DateUpdate     = item.DateUpdate;
            EnCity         = item.EnCity;
            EnHouseNumber  = item.EnHouseNumber;
            EnNeighborhood = item.EnNeighborhood;
            EnStreetName   = item.EnStreetName;
            HeCity         = item.HeCity;
            HeHouseNumber  = item.HeHouseNumber;
            HeNeighborhood = item.HeNeighborhood;
            HeStreetName   = item.HeStreetName;
            Latitude       = item.Latitude;
            Longitude      = item.Longitude;
            AriaBase       = item.AriaBase;
            Balconies      = item.Balconies;
            Bathrooms      = item.Bathrooms;
            Elevators      = item.Elevators;
            FloorOn        = item.FloorOn;
            FloorOf        = item.FloorOf;
            Rooms          = item.Rooms;
            Toilets        = item.Toilets;
            ContactEmail   = item.ContactEmail;
            ContactName    = item.ContactName;
            ContactPhone   = item.ContactPhone;
            Description    = item.Description;
            Price          = item.Price;
            PropertyType   = item.PropertyType;
            Section        = item.Section;
            Images         = item.Images;
            Videos         = item.Videos;

            return(this);
        }
示例#3
0
        public async Task <List <AdItemOnmapDomainModel> > ScrapePhase3Async(ScraperOnmapStateModel state)
        {
            var listRowsDomainModel = new List <AdItemOnmapDomainModel>();
            var files = GetListItemFiles(state);

            foreach (var itemFile in files)
            {
                var dto = await LoadDtoItemFromPathAsync(itemFile);

                if (dto != null)
                {
                    var rowDomainModel = new AdItemOnmapDomainModel().FromDto(dto);
                    listRowsDomainModel.Add(rowDomainModel);
                }
                else
                {
                    _log($"Error dto is null. File: {itemFile.Name}");
                }
            }

            return(listRowsDomainModel);
        }