Gossage dans API
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user