Refactoring, database structure changed
This commit is contained in:
59
WatchIt.Database/Model/Accounts/Account.cs
Normal file
59
WatchIt.Database/Model/Accounts/Account.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
using WatchIt.Database.Model.Genders;
|
||||
using WatchIt.Database.Model.Media;
|
||||
using WatchIt.Database.Model.Roles;
|
||||
|
||||
namespace WatchIt.Database.Model.Accounts;
|
||||
|
||||
public class Account
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
public long Id { get; set; }
|
||||
public string Username { get; set; } = default!;
|
||||
public string Email { get; set; } = default!;
|
||||
public byte[] Password { get; set; } = default!;
|
||||
public string LeftSalt { get; set; } = default!;
|
||||
public string RightSalt { get; set; } = default!;
|
||||
public bool IsAdmin { get; set; } = false;
|
||||
public DateTimeOffset JoinDate { get; set; }
|
||||
public DateTimeOffset ActiveDate { get; set; }
|
||||
public string? Description { get; set; }
|
||||
public short? GenderId { get; set; }
|
||||
public uint Version { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region NAVIGATION
|
||||
|
||||
// Profile picture
|
||||
public virtual AccountProfilePicture? ProfilePicture { get; set; }
|
||||
|
||||
// Background picture
|
||||
public virtual AccountBackgroundPicture? BackgroundPicture { get; set; }
|
||||
|
||||
// Refresh tokens
|
||||
public virtual IEnumerable<AccountRefreshToken> RefreshTokens { get; set; } = new List<AccountRefreshToken>();
|
||||
|
||||
// Follows
|
||||
public virtual IEnumerable<AccountFollow> FollowsRelationshipObjects { get; set; } = new List<AccountFollow>();
|
||||
public virtual IEnumerable<Account> Follows { get; set; } = new List<Account>();
|
||||
|
||||
// Followers
|
||||
public virtual IEnumerable<AccountFollow> FollowersRelationshipObjects { get; set; } = new List<AccountFollow>();
|
||||
public virtual IEnumerable<Account> Followers { get; set; } = new List<Account>();
|
||||
|
||||
// Gender
|
||||
public virtual Gender? Gender { get; set; }
|
||||
|
||||
// Media ratings
|
||||
public virtual IEnumerable<MediumRating> MediaRatings { get; set; } = new List<MediumRating>();
|
||||
public virtual IEnumerable<Medium> MediaRated { get; set; } = new List<Medium>();
|
||||
|
||||
// Roles ratings
|
||||
public virtual IEnumerable<RoleRating> RolesRatings { get; set; } = new List<RoleRating>();
|
||||
public virtual IEnumerable<Role> RolesRated { get; set; } = new List<Role>();
|
||||
|
||||
#endregion
|
||||
}
|
||||
26
WatchIt.Database/Model/Accounts/AccountBackgroundPicture.cs
Normal file
26
WatchIt.Database/Model/Accounts/AccountBackgroundPicture.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using WatchIt.Database.Model.Photos;
|
||||
|
||||
namespace WatchIt.Database.Model.Accounts;
|
||||
|
||||
public class AccountBackgroundPicture
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
public long AccountId { get; set; }
|
||||
public Guid BackgroundId { get; set; }
|
||||
public uint Version { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region NAVIGATION
|
||||
|
||||
// Account
|
||||
public virtual Account Account { get; set; } = default!;
|
||||
|
||||
// Background
|
||||
public virtual PhotoBackground Background { get; set; } = default!;
|
||||
|
||||
#endregion
|
||||
}
|
||||
24
WatchIt.Database/Model/Accounts/AccountFollow.cs
Normal file
24
WatchIt.Database/Model/Accounts/AccountFollow.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
namespace WatchIt.Database.Model.Accounts;
|
||||
|
||||
public class AccountFollow
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
public long FollowerId { get; set; }
|
||||
public long FollowedId { get; set; }
|
||||
public uint Version { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region NAVIGATION
|
||||
|
||||
// Follower
|
||||
public virtual Account Follower { get; set; } = default!;
|
||||
|
||||
// Followed
|
||||
public virtual Account Followed { get; set; } = default!;
|
||||
|
||||
#endregion
|
||||
}
|
||||
23
WatchIt.Database/Model/Accounts/AccountProfilePicture.cs
Normal file
23
WatchIt.Database/Model/Accounts/AccountProfilePicture.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
namespace WatchIt.Database.Model.Accounts;
|
||||
|
||||
public class AccountProfilePicture : IImageEntity
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
public long AccountId { get; set; }
|
||||
public byte[] Image { get; set; } = default!;
|
||||
public string MimeType { get; set; } = default!;
|
||||
public DateTimeOffset UploadDate { get; set; }
|
||||
public uint Version { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region NAVIGATION
|
||||
|
||||
// Account
|
||||
public virtual Account Account { get; set; } = default!;
|
||||
|
||||
#endregion
|
||||
}
|
||||
23
WatchIt.Database/Model/Accounts/AccountRefreshToken.cs
Normal file
23
WatchIt.Database/Model/Accounts/AccountRefreshToken.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
namespace WatchIt.Database.Model.Accounts;
|
||||
|
||||
public class AccountRefreshToken
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
public Guid Token { get; set; }
|
||||
public long AccountId { get; set; }
|
||||
public DateTimeOffset ExpirationDate { get; set; }
|
||||
public bool IsExtendable { get; set; }
|
||||
public uint Version { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region NAVIGATION
|
||||
|
||||
// Account
|
||||
public virtual Account Account { get; set; } = default!;
|
||||
|
||||
#endregion
|
||||
}
|
||||
26
WatchIt.Database/Model/Genders/Gender.cs
Normal file
26
WatchIt.Database/Model/Genders/Gender.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using WatchIt.Database.Model.Accounts;
|
||||
|
||||
namespace WatchIt.Database.Model.Genders;
|
||||
|
||||
public class Gender
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
public short Id { get; set; }
|
||||
public string Name { get; set; } = default!;
|
||||
public uint Version { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region NAVIGATION
|
||||
|
||||
// Accounts
|
||||
public virtual IEnumerable<Account> Accounts { get; set; } = new List<Account>();
|
||||
|
||||
// People
|
||||
public virtual IEnumerable<People.Person> People { get; set; } = new List<People.Person>();
|
||||
|
||||
#endregion
|
||||
}
|
||||
24
WatchIt.Database/Model/Genres/Genre.cs
Normal file
24
WatchIt.Database/Model/Genres/Genre.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using WatchIt.Database.Model.Media;
|
||||
|
||||
namespace WatchIt.Database.Model.Genres;
|
||||
|
||||
public class Genre
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
public short Id { get; set; }
|
||||
public string Name { get; set; } = default!;
|
||||
public uint Version { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region NAVIGATION
|
||||
|
||||
// Media
|
||||
public virtual IEnumerable<MediumGenre> MediaRelationObjects { get; set; } = new List<MediumGenre>();
|
||||
public virtual IEnumerable<Medium> Media { get; set; } = new List<Medium>();
|
||||
|
||||
#endregion
|
||||
}
|
||||
12
WatchIt.Database/Model/IImageEntity.cs
Normal file
12
WatchIt.Database/Model/IImageEntity.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace WatchIt.Database.Model;
|
||||
|
||||
public interface IImageEntity
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
byte[] Image { get; set; }
|
||||
string MimeType { get; set; }
|
||||
DateTimeOffset UploadDate { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
23
WatchIt.Database/Model/IRatingEntity.cs
Normal file
23
WatchIt.Database/Model/IRatingEntity.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using WatchIt.Database.Model.Media;
|
||||
|
||||
namespace WatchIt.Database.Model;
|
||||
|
||||
public interface IRatingEntity
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
long AccountId { get; set; }
|
||||
byte Rating { get; set; }
|
||||
DateTime Date { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region NAVIGATION
|
||||
|
||||
// Account
|
||||
Accounts.Account Account { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
11
WatchIt.Database/Model/IViewCountEntity.cs
Normal file
11
WatchIt.Database/Model/IViewCountEntity.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace WatchIt.Database.Model;
|
||||
|
||||
public interface IViewCountEntity
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
DateOnly Date { get; set; }
|
||||
long ViewCount { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
47
WatchIt.Database/Model/Media/Medium.cs
Normal file
47
WatchIt.Database/Model/Media/Medium.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using WatchIt.Database.Model.Genres;
|
||||
using WatchIt.Database.Model.Photos;
|
||||
using WatchIt.Database.Model.Roles;
|
||||
|
||||
namespace WatchIt.Database.Model.Media;
|
||||
|
||||
public abstract class Medium
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
public long Id { get; set; }
|
||||
public MediumType Type { get; set; }
|
||||
public string Title { get; set; } = default!;
|
||||
public string? OriginalTitle { get; set; }
|
||||
public string? Description { get; set; }
|
||||
public short? Duration { get; set; }
|
||||
public DateOnly? ReleaseDate { get; set; }
|
||||
public uint Version { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region NAVIGATION
|
||||
|
||||
// Genres
|
||||
public virtual IEnumerable<MediumGenre> GenresRelationshipObjects { get; set; } = new List<MediumGenre>();
|
||||
public virtual IEnumerable<Genre> Genres { get; set; } = new List<Genre>();
|
||||
|
||||
// Picture
|
||||
public virtual MediumPicture? Picture { get; set; }
|
||||
|
||||
// Photos
|
||||
public virtual IEnumerable<Photo> Photos { get; set; } = new List<Photo>();
|
||||
|
||||
// View counts
|
||||
public virtual IEnumerable<MediumViewCount> ViewCounts { get; set; } = new List<MediumViewCount>();
|
||||
|
||||
// Ratings
|
||||
public virtual IEnumerable<MediumRating> Ratings { get; set; } = new List<MediumRating>();
|
||||
public virtual IEnumerable<Accounts.Account> RatedBy { get; set; } = new List<Accounts.Account>();
|
||||
|
||||
// Roles
|
||||
public virtual IEnumerable<Role> Roles { get; set; } = new List<Role>();
|
||||
|
||||
#endregion
|
||||
}
|
||||
26
WatchIt.Database/Model/Media/MediumGenre.cs
Normal file
26
WatchIt.Database/Model/Media/MediumGenre.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using WatchIt.Database.Model.Genres;
|
||||
|
||||
namespace WatchIt.Database.Model.Media;
|
||||
|
||||
public class MediumGenre
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
public long MediumId { get; set; }
|
||||
public short GenreId { get; set; }
|
||||
public uint Version { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region NAVIGATION
|
||||
|
||||
// Medium
|
||||
public virtual Medium Medium { get; set; } = default!;
|
||||
|
||||
// Genre
|
||||
public virtual Genre Genre { get; set; } = default!;
|
||||
|
||||
#endregion
|
||||
}
|
||||
10
WatchIt.Database/Model/Media/MediumMovie.cs
Normal file
10
WatchIt.Database/Model/Media/MediumMovie.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace WatchIt.Database.Model.Media;
|
||||
|
||||
public class MediumMovie : Medium
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
public decimal? Budget { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
22
WatchIt.Database/Model/Media/MediumPicture.cs
Normal file
22
WatchIt.Database/Model/Media/MediumPicture.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
namespace WatchIt.Database.Model.Media;
|
||||
|
||||
public class MediumPicture : IImageEntity
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
public long MediumId { get; set; }
|
||||
public byte[] Image { get; set; } = default!;
|
||||
public string MimeType { get; set; } = default!;
|
||||
public DateTimeOffset UploadDate { get; set; }
|
||||
public uint Version { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region NAVIGATION
|
||||
|
||||
public virtual Medium Medium { get; set; } = default!;
|
||||
|
||||
#endregion
|
||||
}
|
||||
26
WatchIt.Database/Model/Media/MediumRating.cs
Normal file
26
WatchIt.Database/Model/Media/MediumRating.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
namespace WatchIt.Database.Model.Media;
|
||||
|
||||
public class MediumRating : IRatingEntity
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
public long AccountId { get; set; }
|
||||
public long MediumId { get; set; }
|
||||
public byte Rating { get; set; }
|
||||
public DateTime Date { get; set; }
|
||||
public uint Version { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region NAVIGATION
|
||||
|
||||
// Account
|
||||
public virtual Accounts.Account Account { get; set; } = default!;
|
||||
|
||||
// Medium
|
||||
public virtual Medium Medium { get; set; } = default!;
|
||||
|
||||
#endregion
|
||||
}
|
||||
10
WatchIt.Database/Model/Media/MediumSeries.cs
Normal file
10
WatchIt.Database/Model/Media/MediumSeries.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace WatchIt.Database.Model.Media;
|
||||
|
||||
public class MediumSeries : Medium
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
public bool HasEnded { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
7
WatchIt.Database/Model/Media/MediumType.cs
Normal file
7
WatchIt.Database/Model/Media/MediumType.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace WatchIt.Database.Model.Media;
|
||||
|
||||
public enum MediumType : byte
|
||||
{
|
||||
Movie = 0,
|
||||
Series = 1,
|
||||
}
|
||||
23
WatchIt.Database/Model/Media/MediumViewCount.cs
Normal file
23
WatchIt.Database/Model/Media/MediumViewCount.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using WatchIt.Database.Model.Media;
|
||||
|
||||
namespace WatchIt.Database.Model.Media;
|
||||
|
||||
public class MediumViewCount : IViewCountEntity
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
public long MediumId { get; set; }
|
||||
public DateOnly Date { get; set; }
|
||||
public long ViewCount { get; set; }
|
||||
public uint Version { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region NAVIGATION
|
||||
|
||||
public virtual Medium Medium { get; set; } = default!;
|
||||
|
||||
#endregion
|
||||
}
|
||||
38
WatchIt.Database/Model/People/Person.cs
Normal file
38
WatchIt.Database/Model/People/Person.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using WatchIt.Database.Model.Genders;
|
||||
using WatchIt.Database.Model.Roles;
|
||||
|
||||
namespace WatchIt.Database.Model.People;
|
||||
|
||||
public class Person
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
public long Id { get; set; }
|
||||
public string Name { get; set; } = default!;
|
||||
public string? FullName { get; set; }
|
||||
public string? Description { get; set; }
|
||||
public DateOnly? BirthDate { get; set; }
|
||||
public DateOnly? DeathDate { get; set; }
|
||||
public short? GenderId { get; set; }
|
||||
public uint Version { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region NAVIGATION
|
||||
|
||||
// Gender
|
||||
public virtual Gender? Gender { get; set; }
|
||||
|
||||
// Picture
|
||||
public virtual PersonPicture? Picture { get; set; }
|
||||
|
||||
// View counts
|
||||
public virtual IEnumerable<PersonViewCount> ViewCounts { get; set; } = new List<PersonViewCount>();
|
||||
|
||||
// Roles
|
||||
public virtual IEnumerable<Role> Roles { get; set; } = new List<Role>();
|
||||
|
||||
#endregion
|
||||
}
|
||||
22
WatchIt.Database/Model/People/PersonPicture.cs
Normal file
22
WatchIt.Database/Model/People/PersonPicture.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
namespace WatchIt.Database.Model.People;
|
||||
|
||||
public class PersonPicture : IImageEntity
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
public long PersonId { get; set; }
|
||||
public byte[] Image { get; set; } = default!;
|
||||
public string MimeType { get; set; } = default!;
|
||||
public DateTimeOffset UploadDate { get; set; }
|
||||
public uint Version { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region NAVIGATION
|
||||
|
||||
public virtual Person Person { get; set; } = default!;
|
||||
|
||||
#endregion
|
||||
}
|
||||
21
WatchIt.Database/Model/People/PersonViewCount.cs
Normal file
21
WatchIt.Database/Model/People/PersonViewCount.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
namespace WatchIt.Database.Model.People;
|
||||
|
||||
public class PersonViewCount : IViewCountEntity
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
public long PersonId { get; set; }
|
||||
public DateOnly Date { get; set; }
|
||||
public long ViewCount { get; set; }
|
||||
public uint Version { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region NAVIGATION
|
||||
|
||||
public virtual Person Person { get; set; } = default!;
|
||||
|
||||
#endregion
|
||||
}
|
||||
29
WatchIt.Database/Model/Photos/Photo.cs
Normal file
29
WatchIt.Database/Model/Photos/Photo.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using WatchIt.Database.Model.Media;
|
||||
|
||||
namespace WatchIt.Database.Model.Photos;
|
||||
|
||||
public class Photo : IImageEntity
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
public Guid Id { get; set; }
|
||||
public long MediumId { get; set; }
|
||||
public byte[] Image { get; set; } = null!;
|
||||
public string MimeType { get; set; } = null!;
|
||||
public DateTimeOffset UploadDate { get; set; }
|
||||
public uint Version { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region NAVIGATION
|
||||
|
||||
// Medium
|
||||
public virtual Medium Medium { get; set; } = default!;
|
||||
|
||||
// Background settings
|
||||
public virtual PhotoBackground? Background { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
30
WatchIt.Database/Model/Photos/PhotoBackground.cs
Normal file
30
WatchIt.Database/Model/Photos/PhotoBackground.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System.Drawing;
|
||||
using WatchIt.Database.Model.Accounts;
|
||||
|
||||
namespace WatchIt.Database.Model.Photos;
|
||||
|
||||
public class PhotoBackground
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
public Guid Id { get; set; }
|
||||
public Guid PhotoId { get; set; }
|
||||
public bool IsUniversal { get; set; }
|
||||
public Color FirstGradientColor { get; set; }
|
||||
public Color SecondGradientColor { get; set; }
|
||||
public uint Version { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region NAVIGATION
|
||||
|
||||
// Photo
|
||||
public virtual Photo Photo { get; set; } = default!;
|
||||
|
||||
// Background usages
|
||||
public virtual IEnumerable<AccountBackgroundPicture> BackgroundUsages { get; set; } = new List<AccountBackgroundPicture>();
|
||||
|
||||
#endregion
|
||||
}
|
||||
32
WatchIt.Database/Model/Roles/Role.cs
Normal file
32
WatchIt.Database/Model/Roles/Role.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using WatchIt.Database.Model.Media;
|
||||
|
||||
namespace WatchIt.Database.Model.Roles;
|
||||
|
||||
public abstract class Role
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
public Guid Id { get; set; }
|
||||
public RoleType Type { get; set; }
|
||||
public long MediumId { get; set; }
|
||||
public long PersonId { get; set; }
|
||||
public uint Version { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region NAVIGATION
|
||||
|
||||
// Medium
|
||||
public virtual Medium Medium { get; set; } = default!;
|
||||
|
||||
// Person
|
||||
public virtual People.Person Person { get; set; } = default!;
|
||||
|
||||
// Ratings
|
||||
public virtual IEnumerable<RoleRating> Ratings { get; set; } = default!;
|
||||
public virtual IEnumerable<Accounts.Account> RatedBy { get; set; } = default!;
|
||||
|
||||
#endregion
|
||||
}
|
||||
20
WatchIt.Database/Model/Roles/RoleActor.cs
Normal file
20
WatchIt.Database/Model/Roles/RoleActor.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
namespace WatchIt.Database.Model.Roles;
|
||||
|
||||
public class RoleActor : Role
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
public short ActorTypeId { get; set; }
|
||||
public string Name { get; set; } = default!;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region NAVIGATION
|
||||
|
||||
// Actor type
|
||||
public virtual RoleActorType ActorType { get; set; } = default!;
|
||||
|
||||
#endregion
|
||||
}
|
||||
20
WatchIt.Database/Model/Roles/RoleActorType.cs
Normal file
20
WatchIt.Database/Model/Roles/RoleActorType.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
namespace WatchIt.Database.Model.Roles;
|
||||
|
||||
public class RoleActorType
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
public short Id { get; set; }
|
||||
public string Name { get; set; } = default!;
|
||||
public uint Version { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region NAVIGATION
|
||||
|
||||
public virtual IEnumerable<RoleActor> Roles { get; set; } = new List<RoleActor>();
|
||||
|
||||
#endregion
|
||||
}
|
||||
19
WatchIt.Database/Model/Roles/RoleCreator.cs
Normal file
19
WatchIt.Database/Model/Roles/RoleCreator.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
namespace WatchIt.Database.Model.Roles;
|
||||
|
||||
public class RoleCreator : Role
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
public short CreatorTypeId { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region NAVIGATION
|
||||
|
||||
// Creator type
|
||||
public virtual RoleCreatorType CreatorType { get; set; } = default!;
|
||||
|
||||
#endregion
|
||||
}
|
||||
20
WatchIt.Database/Model/Roles/RoleCreatorType.cs
Normal file
20
WatchIt.Database/Model/Roles/RoleCreatorType.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
namespace WatchIt.Database.Model.Roles;
|
||||
|
||||
public class RoleCreatorType
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
public short Id { get; set; }
|
||||
public string Name { get; set; } = default!;
|
||||
public uint Version { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region NAVIGATION
|
||||
|
||||
public virtual IEnumerable<RoleCreator> Roles { get; set; } = new List<RoleCreator>();
|
||||
|
||||
#endregion
|
||||
}
|
||||
26
WatchIt.Database/Model/Roles/RoleRating.cs
Normal file
26
WatchIt.Database/Model/Roles/RoleRating.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
namespace WatchIt.Database.Model.Roles;
|
||||
|
||||
public class RoleRating : IRatingEntity
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
public long AccountId { get; set; }
|
||||
public Guid RoleId { get; set; }
|
||||
public byte Rating { get; set; }
|
||||
public DateTime Date { get; set; }
|
||||
public uint Version { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region NAVIGATION
|
||||
|
||||
// Account
|
||||
public virtual Accounts.Account Account { get; set; } = default!;
|
||||
|
||||
// Role
|
||||
public virtual Role Role { get; set; } = default!;
|
||||
|
||||
#endregion
|
||||
}
|
||||
7
WatchIt.Database/Model/Roles/RoleType.cs
Normal file
7
WatchIt.Database/Model/Roles/RoleType.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace WatchIt.Database.Model.Roles;
|
||||
|
||||
public enum RoleType : byte
|
||||
{
|
||||
Actor = 0,
|
||||
Creator = 1,
|
||||
}
|
||||
Reference in New Issue
Block a user