Début API

This commit is contained in:
MarcEricMartel
2022-10-08 10:22:12 -07:00
parent 8b4c7e5684
commit 7ce0e7a83f
7 changed files with 112 additions and 47 deletions

View File

@@ -0,0 +1,15 @@
using System.ComponentModel.DataAnnotations;
namespace GrossesMitainesAPI.Models;
public class Product {
[Key]
public int Id { get; set; }
[Required, MaxLength(255)]
public string Title { get; set; } = "";
[Required]
public string Description { get; set; } = "";
[Range(0, (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.
}