reactredux/webapi/WeatherForecast/Models/Requests/PutShopCartItemRequestModel.cs

35 lines
954 B
C#

using Core.Abstractions.Models;
using Core.DomainObjects;
using Core.DomainObjects.Documents;
namespace WeatherForecast.Models.Requests {
public class PutShopCartItemRequestModel : PostItemRequestModel<ShopCartItem> {
public string Slug { get; set; }
public ImageModel Image { 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 ShopCartItem ToDomainObject() => new ShopCartItem {
Slug = Slug,
Image = new Image {
Src = Image.Src,
Alt = Image.Alt
},
Title = Title,
BrandName = BrandName,
ShortText = ShortText,
Created = Created,
Price = Price,
NewPrice = NewPrice,
Quantity = Quantity
};
}
}