Gossage dans API

This commit is contained in:
MarcEricMartel
2022-10-27 09:37:13 -07:00
parent 04c7d68a44
commit 83331a4a08
10 changed files with 213 additions and 39 deletions

View File

@@ -0,0 +1,27 @@
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;
}
}