33 lines
966 B
C#
33 lines
966 B
C#
using Core.Abstractions.Models;
|
|
using Core.DomainObjects;
|
|
using Core.DomainObjects.Documents;
|
|
|
|
namespace WeatherForecast.Models.Requests {
|
|
public class PostShopItemRequestModel : PostItemRequestModel<ShopItem> {
|
|
public string Slug { get; set; }
|
|
public List<ImageModel> 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
|
|
};
|
|
}
|
|
}
|