GGMM/GrossesMitaines/GrossesMitainesAPI/Models/Product.cs

15 lines
576 B
C#
Raw Normal View History

2022-10-08 13:22:12 -04:00
using System.ComponentModel.DataAnnotations;
namespace GrossesMitainesAPI.Models;
public class Product {
[Key]
public int Id { get; set; }
[Required, MaxLength(255)]
2022-10-08 13:41:55 -04:00
public string Title { get; set; } = "Erreur Aucun Objet";
2022-10-08 13:22:12 -04:00
[Required]
2022-10-08 13:41:55 -04:00
public string Description { get; set; } = "Lorem Ipsum.";
[Range(0.01, (double)decimal.MaxValue)] // Range qui prend pas les decimals!
2022-10-08 13:22:12 -04:00
public decimal Price { get; set; } = 0;
2022-10-09 13:18:39 -04:00
public string? ImageName { get; set; } // Base pour sortir les images ({ImageName}.png , {ImageName}_thumbnail.png, etc...)
2022-10-08 13:22:12 -04:00
}