GGMM/GrossesMitaines/GrossesMitainesAPI/Models/Product.cs
MarcEricMartel e2b33cc7ac API
2022-10-08 10:41:55 -07:00

15 lines
525 B
C#

using System.ComponentModel.DataAnnotations;
namespace GrossesMitainesAPI.Models;
public class Product {
[Key]
public int Id { get; set; }
[Required, MaxLength(255)]
public string Title { get; set; } = "Erreur Aucun Objet";
[Required]
public string Description { get; set; } = "Lorem Ipsum.";
[Range(0.01, (double)decimal.MaxValue)] // Range qui prend pas les decimals!
public decimal Price { get; set; } = 0;
public string? ImageData { get; set; } // Base64 en string pour le html.
}