using static GrossesMitainesAPI.Models.ProductModel; 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(ProductModel 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; } }