public static GumtreeTopicDocument AsUpdateParentDocument(this GumtreeTopicDocument firstDocument)
 {
     firstDocument.LastUpdate   = DateTime.Now;
     firstDocument.PriceChanged = true;
     firstDocument.RelatedId    = firstDocument.Id;
     return(firstDocument);
 }
 public static GumtreeTopicDto AsDto(this GumtreeTopicDocument document)
 => new GumtreeTopicDto
 {
     Title        = document.Title,
     Garage       = document.Garage,
     Url          = document.Url,
     CreatedDate  = document.CreatedDate.ToString(),
     PropertyType = document.PropertyType,
     Price        = document.Price,
     Province     = document.Province,
     City         = document.City,
     Id           = document.Id,
     SizeM2       = document.SizeM2,
     PricePerM2   = document.PricePerM2,
     Description  = document.Description
 };
        private static GumtreeTopicDocument DtoToDocument(GumtreeTopicDto dto)
        {
            var document = new GumtreeTopicDocument
            {
                Id           = dto.Id,
                PropertyType = dto.PropertyType,
                Garage       = dto.Garage,
                Price        = dto.Price,
                TimeStamp    = DateTime.Now,
                Title        = dto.Title,
                Url          = dto.Url,
                SizeM2       = dto.SizeM2,
                City         = dto.City.Contains(dto.Province)
                    ? dto.City.Replace(dto.Province, "").Replace(" ", "").Replace(",", "")
                    : dto.City,
                Province    = dto.Province,
                PricePerM2  = Math.Round(dto.Price / dto.SizeM2, 3),
                Description = dto.Description,
                CreatedDate = Convert.ToDateTime(dto.CreatedDate)
            };

            return(document);
        }
 public static GumtreeTopicDocument AsUpdateDocument(this GumtreeTopicDocument firstDocument)
 {
     firstDocument.LastUpdate = DateTime.Now;
     return(firstDocument);
 }