API
This commit is contained in:
parent
7ce0e7a83f
commit
e2b33cc7ac
@ -6,8 +6,7 @@ using Microsoft.Extensions.Logging;
|
|||||||
|
|
||||||
namespace GrossesMitainesAPI.Controllers;
|
namespace GrossesMitainesAPI.Controllers;
|
||||||
|
|
||||||
[ApiController]
|
[ApiController, Route("[controller]")]
|
||||||
[Route("[controller]")]
|
|
||||||
public class InventoryController : Controller {
|
public class InventoryController : Controller {
|
||||||
private readonly ILogger<InventoryController> _logger;
|
private readonly ILogger<InventoryController> _logger;
|
||||||
private readonly InventoryContext _context;
|
private readonly InventoryContext _context;
|
||||||
|
@ -6,10 +6,10 @@ public class Product {
|
|||||||
[Key]
|
[Key]
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
[Required, MaxLength(255)]
|
[Required, MaxLength(255)]
|
||||||
public string Title { get; set; } = "";
|
public string Title { get; set; } = "Erreur Aucun Objet";
|
||||||
[Required]
|
[Required]
|
||||||
public string Description { get; set; } = "";
|
public string Description { get; set; } = "Lorem Ipsum.";
|
||||||
[Range(0, (double)decimal.MaxValue)] // Range qui prend pas les decimals!
|
[Range(0.01, (double)decimal.MaxValue)] // Range qui prend pas les decimals!
|
||||||
public decimal Price { get; set; } = 0;
|
public decimal Price { get; set; } = 0;
|
||||||
public string? ImageData { get; set; } // Base64 en string pour le html.
|
public string? ImageData { get; set; } // Base64 en string pour le html.
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user