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