using Core.Abstractions.Models; using Core.DomainObjects; using Core.DomainObjects.Documents; namespace WeatherForecast.Models.Requests { public class PostShopItemRequestModel : PostItemRequestModel { public string Slug { get; set; } public List Images { get; set; } public string Title { get; set; } public string BrandName { get; set; } public string ShortText { get; set; } public DateTime Created { get; set; } public double Price { get; set; } public double NewPrice { get; set; } public uint Quantity { get; set; } public override ShopItem ToDomainObject() => new ShopItem { Slug = Slug, Images = Images.Select(x => new Image { Src = x.Src, Alt = x.Alt }).ToList(), Title = Title, BrandName = BrandName, ShortText = ShortText, Created = Created, Price = Price, NewPrice = NewPrice, Quantity = Quantity }; } }