diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/AgenceSqlDto.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/AgenceSqlDto.cs index 8680156..5059f70 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/AgenceSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/AgenceSqlDto.cs @@ -1,10 +1,14 @@ -using System.Diagnostics.CodeAnalysis; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Diagnostics.CodeAnalysis; using espacecollab.backend.infrastructure.sql.dtos.Interfaces; namespace espacecollab.backend.infrastructure.sql.dtos; +[Table("agence")] public class AgenceSqlDto : IGenericIdSqlDto { + [Key] public int Id { get; set; } public string Name { get; set; } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/BusinessUnitSqlDto.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/BusinessUnitSqlDto.cs index c311787..ce6534e 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/BusinessUnitSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/BusinessUnitSqlDto.cs @@ -1,10 +1,14 @@ -using System.Diagnostics.CodeAnalysis; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Diagnostics.CodeAnalysis; using espacecollab.backend.infrastructure.sql.dtos.Interfaces; namespace espacecollab.backend.infrastructure.sql.dtos; +[Table("businessunit")] public class BusinessUnitSqlDto : IGenericIdSqlDto { + [Key] public int Id { get; set; } public string Name { get; set; } public int AgenceId { get; set; } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurSqlDto.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurSqlDto.cs index b01751e..8803af6 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurSqlDto.cs @@ -2,9 +2,11 @@ using System.Diagnostics.CodeAnalysis; using espacecollab.backend.infrastructure.sql.dtos.Interfaces; using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; namespace espacecollab.backend.infrastructure.sql.dtos; +[Table("collaborateur")] public class CollaborateurSqlDto : IGenericIdSqlDto { [Key] diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/FonctionSqlDto.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/FonctionSqlDto.cs index 0246266..b1d03db 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/FonctionSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/FonctionSqlDto.cs @@ -1,10 +1,14 @@ -using System.Diagnostics.CodeAnalysis; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Diagnostics.CodeAnalysis; using espacecollab.backend.infrastructure.sql.dtos.Interfaces; namespace espacecollab.backend.infrastructure.sql.dtos { + [Table("fonction")] public class FonctionSqlDto : IGenericIdSqlDto { + [Key] public int Id { get; set; } public string Intitule { get; set; } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/PeriodeEssaiSqlDto.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/PeriodeEssaiSqlDto.cs index 8d361de..78e8327 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/PeriodeEssaiSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/PeriodeEssaiSqlDto.cs @@ -1,11 +1,15 @@ using espacecollab.backend.infrastructure.sql.dtos.Values; using System.Diagnostics.CodeAnalysis; using espacecollab.backend.infrastructure.sql.dtos.Interfaces; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; namespace espacecollab.backend.infrastructure.sql.dtos; +[Table("periodeessai")] public class PeriodeEssaiSqlDto : IGenericIdSqlDto { + [Key] public int Id { get; set; } public DateTime StartingDate { get; set; } public DateTime PlannedEndingDate { get; set; } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/ProjetSqlDto.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/ProjetSqlDto.cs index 9cd830b..fc1198b 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/ProjetSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/ProjetSqlDto.cs @@ -1,10 +1,14 @@ -using System.Diagnostics.CodeAnalysis; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Diagnostics.CodeAnalysis; using espacecollab.backend.infrastructure.sql.dtos.Interfaces; namespace espacecollab.backend.infrastructure.sql.dtos; +[Table("projet")] public class ProjetSqlDto : IGenericIdSqlDto { + [Key] public int Id { get; set; } public string Name { get; set; } public string Client { get; set; } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/ReferencementSqlDto.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/ReferencementSqlDto.cs index 09318a5..11dd489 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/ReferencementSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/ReferencementSqlDto.cs @@ -1,10 +1,14 @@ -using System.Diagnostics.CodeAnalysis; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Diagnostics.CodeAnalysis; using espacecollab.backend.infrastructure.sql.dtos.Interfaces; namespace espacecollab.backend.infrastructure.sql.dtos; +[Table("referencement")] public class ReferencementSqlDto : IGenericIdSqlDto { + [Key] public int Id { get; set; } public DateTime StartingDate { get; set; } public DateTime EndingDate { get; set; } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/SiteSqlDto.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/SiteSqlDto.cs index f639708..6a7faa4 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/SiteSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/SiteSqlDto.cs @@ -1,10 +1,14 @@ -using System.Diagnostics.CodeAnalysis; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Diagnostics.CodeAnalysis; using espacecollab.backend.infrastructure.sql.dtos.Interfaces; namespace espacecollab.backend.infrastructure.sql.dtos; +[Table("site")] public class SiteSqlDto : IGenericIdSqlDto { + [Key] public int Id { get; set; } public string Name { get; set; } public string Address { get; set; } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/TechnologieSqlDto.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/TechnologieSqlDto.cs index 01df2e0..3654135 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/TechnologieSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/TechnologieSqlDto.cs @@ -1,10 +1,14 @@ using espacecollab.backend.infrastructure.sql.dtos.Interfaces; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; using System.Diagnostics.CodeAnalysis; namespace espacecollab.backend.infrastructure.sql.dtos; +[Table("technologie")] public class TechnologieSqlDto : IGenericIdSqlDto { + [Key] public int Id { get; set; } public string Name { get; set; } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/MainDbContext.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/MainDbContext.cs index b5a1163..1f7f0bd 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/MainDbContext.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/MainDbContext.cs @@ -28,12 +28,10 @@ public class MainDbContext : DbContext modelBuilder.Entity().Property(p => p.Id).UseMySqlIdentityColumn(); modelBuilder.Entity().Property(p => p.Id).UseMySqlIdentityColumn(); modelBuilder.Entity().Property(p => p.Id).UseMySqlIdentityColumn(); - modelBuilder .Entity() .Property(e => e.Gender) .HasConversion(); - modelBuilder .Entity() .Property(e => e.Status)