Refactoring, database structure changed
This commit is contained in:
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
|
||||
}
|
||||
Reference in New Issue
Block a user