PIbd-31_PotapovNS_COP_20/InternetShop/InternetShopContracts/DataViewModels/OrderViewModel.cs

31 lines
991 B
C#

using InternetShopDataModels.Models;
using System.ComponentModel;
namespace InternetShopContracts.DataViewModels
{
public class OrderViewModel : IOrderModel
{
[DisplayName("ФИО заказчика")]
public string CustomerFIO { get; set; } = string.Empty;
[DisplayName("Email заказчика")]
public string CustomerEmail { get; set; } = string.Empty;
[DisplayName("Изображение")]
public string ImagePath { get; set; } = string.Empty;
[DisplayName("Товары")]
public List<string> ProductNames { get; set; } = new List<string>();
[DisplayName("ID")]
public int Id { get; set; }
public string ProductsString
{
get
{
return string.Join(", ", ProductNames);
}
set
{
ProductNames = value.Split(',').Select(x => x.ToString().Trim()).ToList();
}
}
}
}