GGMM/GrossesMitaines/GrossesMitainesAPI/Models/ProductViewModel.cs
2022-10-27 09:37:13 -07:00

28 lines
1005 B
C#

using static GrossesMitainesAPI.Models.Product;
using System.ComponentModel.DataAnnotations;
namespace GrossesMitainesAPI.Models;
public class ProductViewModel {
public int Id { get; set; }
public string Title { get; set; } = "Erreur Aucun Objet";
public string Category { get; set; } = "Inconnue";
public string Description { get; set; } = "Lorem Ipsum.";
public decimal Price { get; set; } = 0;
public decimal PromoPrice { get; set; } = 0;
public uint Quantity { get; set; } = 0;
public States Status { get; set; } = States.Available;
public string? ImageName { get; set; }
public ProductViewModel(Product prod) {
this.Id = prod.Id;
this.Title = prod.Title;
this.Category = prod.Category;
this.Description = prod.Description;
this.Price = prod.Price;
this.PromoPrice = prod.PromoPrice;
this.Quantity = prod.Quantity;
this.Status = prod.Status;
this.ImageName = prod.ImageName;
}
}