From 1c1f9b2fcc64b251114134d09bc5a5468d888efe Mon Sep 17 00:00:00 2001 From: oistig Date: Thu, 19 Mar 2026 17:53:02 +0100 Subject: [PATCH] =?UTF-8?q?Changements=20de=20models=20(=C3=A0=20terminer)?= =?UTF-8?q?=20+=20GroupProfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Knots/Models/Discussion.cs | 3 +++ Knots/Models/Group.cs | 3 +++ Knots/Models/Key.cs | 1 + Knots/Models/Message.cs | 3 +++ Knots/Models/User.cs | 1 + Knots/Profiles/GroupProfile.cs | 13 +++++++++++-- 6 files changed, 22 insertions(+), 2 deletions(-) diff --git a/Knots/Models/Discussion.cs b/Knots/Models/Discussion.cs index eb1502b..da7b4b2 100644 --- a/Knots/Models/Discussion.cs +++ b/Knots/Models/Discussion.cs @@ -5,4 +5,7 @@ namespace Knots.Models; public class Discussion { [Key] public int Id { get; set; } + + public List Messages { get; set; } + public Key KeyId { get; set; } } \ No newline at end of file diff --git a/Knots/Models/Group.cs b/Knots/Models/Group.cs index 727c91c..3033285 100644 --- a/Knots/Models/Group.cs +++ b/Knots/Models/Group.cs @@ -9,4 +9,7 @@ public class Group [Required, MaxLength(50)] public string? Name { get; set; } [Required] public int MembersAmount { get; set; } public string? ProfilePicture { get; set; } + public Key KeyId { get; set; } + List Messages { get; set; } + List Users { get; set; } } \ No newline at end of file diff --git a/Knots/Models/Key.cs b/Knots/Models/Key.cs index f222555..a8a847c 100644 --- a/Knots/Models/Key.cs +++ b/Knots/Models/Key.cs @@ -6,4 +6,5 @@ public class Key { [Key] public int Id { get; set; } [Required, MaxLength(50)] public string? EnKey { get; set; } + List Messages { get; set; } } \ No newline at end of file diff --git a/Knots/Models/Message.cs b/Knots/Models/Message.cs index 1545670..872eda4 100644 --- a/Knots/Models/Message.cs +++ b/Knots/Models/Message.cs @@ -8,4 +8,7 @@ public class Message [Required, MaxLength(1000)] public string? Contenu { get; set; } [Required] public DateTime Date { get; set; } [Required] public Boolean Type { get; set; } + public Group Group { get; set; } + public Key Key { get; set; } + public User User { get; set; } } \ No newline at end of file diff --git a/Knots/Models/User.cs b/Knots/Models/User.cs index 7731c58..3937418 100644 --- a/Knots/Models/User.cs +++ b/Knots/Models/User.cs @@ -11,4 +11,5 @@ public class User [Required, MaxLength(70)] public string? Email { get; set; } [Required, Length(10, 10)] public string? Tel { get; set; } public string? ProfilePicture { get; set; } + public List Messages { get; set; } } \ No newline at end of file diff --git a/Knots/Profiles/GroupProfile.cs b/Knots/Profiles/GroupProfile.cs index 7c02241..723f22a 100644 --- a/Knots/Profiles/GroupProfile.cs +++ b/Knots/Profiles/GroupProfile.cs @@ -1,6 +1,15 @@ +using AutoMapper; +using Knots.DTO.Group; +using Knots.Models; + namespace Knots.Profiles; -public class GroupProfile +public class GroupProfile : Profile { - + public GroupProfile() + { + CreateMap(); + CreateMap(); + CreateMap(); + } } \ No newline at end of file