diff options
Diffstat (limited to 'src/Data/DevHive.Data.Models')
| -rw-r--r-- | src/Data/DevHive.Data.Models/Comment.cs | 4 | ||||
| -rw-r--r-- | src/Data/DevHive.Data.Models/DevHive.Data.Models.csproj | 4 | ||||
| -rw-r--r-- | src/Data/DevHive.Data.Models/ProfilePicture.cs | 4 | ||||
| -rw-r--r-- | src/Data/DevHive.Data.Models/RelationalModels/RatedPost.cs | 18 | ||||
| -rw-r--r-- | src/Data/DevHive.Data.Models/RelationalModels/UserRate.cs | 18 | ||||
| -rw-r--r-- | src/Data/DevHive.Data.Models/User.cs | 5 |
6 files changed, 7 insertions, 46 deletions
diff --git a/src/Data/DevHive.Data.Models/Comment.cs b/src/Data/DevHive.Data.Models/Comment.cs index 0af40bf..8a58edd 100644 --- a/src/Data/DevHive.Data.Models/Comment.cs +++ b/src/Data/DevHive.Data.Models/Comment.cs @@ -6,12 +6,8 @@ namespace DevHive.Data.Models { public Guid Id { get; set; } - // public Guid PostId { get; set; } - public Post Post { get; set; } - // public Guid CreatorId { get; set; } - public User Creator { get; set; } public string Message { get; set; } diff --git a/src/Data/DevHive.Data.Models/DevHive.Data.Models.csproj b/src/Data/DevHive.Data.Models/DevHive.Data.Models.csproj index d249c77..2958f86 100644 --- a/src/Data/DevHive.Data.Models/DevHive.Data.Models.csproj +++ b/src/Data/DevHive.Data.Models/DevHive.Data.Models.csproj @@ -4,7 +4,7 @@ </PropertyGroup> <ItemGroup> <PackageReference Include="Microsoft.AspNetCore.Identity" Version="2.2.0"/> - <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="5.0.3"/> - <PackageReference Include="SonarAnalyzer.CSharp" Version="8.19.0.28253"/> + <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="5.0.4"/> + <PackageReference Include="SonarAnalyzer.CSharp" Version="8.20.0.28934"/> </ItemGroup> </Project>
\ No newline at end of file diff --git a/src/Data/DevHive.Data.Models/ProfilePicture.cs b/src/Data/DevHive.Data.Models/ProfilePicture.cs index e2ef04b..e8166d7 100644 --- a/src/Data/DevHive.Data.Models/ProfilePicture.cs +++ b/src/Data/DevHive.Data.Models/ProfilePicture.cs @@ -1,9 +1,13 @@ using System; +using System.ComponentModel.DataAnnotations.Schema; namespace DevHive.Data.Models { + [Table("ProfilePictures")] public class ProfilePicture { + public const string DefaultURL = "/assets/icons/tabler-icon-user.svg"; + public Guid Id { get; set; } public Guid UserId { get; set; } diff --git a/src/Data/DevHive.Data.Models/RelationalModels/RatedPost.cs b/src/Data/DevHive.Data.Models/RelationalModels/RatedPost.cs deleted file mode 100644 index fb63848..0000000 --- a/src/Data/DevHive.Data.Models/RelationalModels/RatedPost.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.ComponentModel.DataAnnotations.Schema; -using System.Reflection.Metadata.Ecma335; -using DevHive.Data.Models; -using Microsoft.EntityFrameworkCore; - -namespace DevHive.Data.Models.Relational -{ - [Table("RatedPosts")] - public class RatedPost - { - public Guid UserId { get; set; } - public User User { get; set; } - - public Guid PostId { get; set; } - public Post Post { get; set; } - } -} diff --git a/src/Data/DevHive.Data.Models/RelationalModels/UserRate.cs b/src/Data/DevHive.Data.Models/RelationalModels/UserRate.cs deleted file mode 100644 index 46bd605..0000000 --- a/src/Data/DevHive.Data.Models/RelationalModels/UserRate.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.ComponentModel.DataAnnotations.Schema; -using DevHive.Data.Models; - -namespace DevHive.Data.Models.Relational -{ - [Table("UserRates")] - public class UserRate - { - public Guid Id { get; set; } - - public User User { get; set; } - - public bool Liked { get; set; } - - public Post Post { get; set; } - } -} diff --git a/src/Data/DevHive.Data.Models/User.cs b/src/Data/DevHive.Data.Models/User.cs index eb5ae41..d3789ec 100644 --- a/src/Data/DevHive.Data.Models/User.cs +++ b/src/Data/DevHive.Data.Models/User.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; -using DevHive.Data.Models.Relational; using Microsoft.AspNetCore.Identity; namespace DevHive.Data.Models @@ -13,7 +12,7 @@ namespace DevHive.Data.Models public string LastName { get; set; } - public ProfilePicture ProfilePicture { get; set; } = new() { PictureURL = "/assets/images/feed/profile-pic.png" }; + public ProfilePicture ProfilePicture { get; set; } = new() { PictureURL = ProfilePicture.DefaultURL }; public HashSet<Language> Languages { get; set; } = new(); @@ -26,7 +25,5 @@ namespace DevHive.Data.Models public HashSet<User> Friends { get; set; } = new(); public HashSet<Comment> Comments { get; set; } = new(); - - public HashSet<RatedPost> RatedPosts { get; set; } = new(); } } |
