From d03d695e6885e84d97849d0a767fb8d81a35ba16 Mon Sep 17 00:00:00 2001 From: Victor GABORIT Date: Wed, 27 Mar 2024 13:24:02 +0100 Subject: [PATCH] changement de UserEntity ajout de unique sur les chanps email et username --- API_SQLuedo/EntityFramework/UserEntity.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/API_SQLuedo/EntityFramework/UserEntity.cs b/API_SQLuedo/EntityFramework/UserEntity.cs index aa2527f..ecbabcc 100644 --- a/API_SQLuedo/EntityFramework/UserEntity.cs +++ b/API_SQLuedo/EntityFramework/UserEntity.cs @@ -1,8 +1,11 @@ using System.ComponentModel.DataAnnotations.Schema; +using Microsoft.EntityFrameworkCore; namespace Entities; [Table("User")] +[Index(nameof(Username), IsUnique = true)] +[Index(nameof(Email), IsUnique = true)] public class UserEntity { public int Id { get; set; }