Adds Blazor Web App standard login
This commit is contained in:
23
WatchLog/Data/DatabaseModels/Global/Genre.cs
Normal file
23
WatchLog/Data/DatabaseModels/Global/Genre.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace WatchLog.Data
|
||||
{
|
||||
public class Genre
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(50)]
|
||||
public required string Name { get; set; }
|
||||
|
||||
[Required]
|
||||
public required DateTime CreationTime { get; set; }
|
||||
|
||||
public DateTime? LastChange { get; set; }
|
||||
|
||||
|
||||
// --- Navigation Properties ---
|
||||
public virtual ICollection<LinkTableGlobalGenre> LinkTableGlobalGenres { get; set; } = new List<LinkTableGlobalGenre>();
|
||||
}
|
||||
}
|
||||
45
WatchLog/Data/DatabaseModels/Global/GlobalEntity.cs
Normal file
45
WatchLog/Data/DatabaseModels/Global/GlobalEntity.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace WatchLog.Data
|
||||
{
|
||||
public class GlobalEntity
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(200)]
|
||||
public required string Title { get; set; }
|
||||
|
||||
[MaxLength(500)]
|
||||
public string? PicturePath { get; set; }
|
||||
|
||||
[Required]
|
||||
public required DateTime CreationTime { get; set; }
|
||||
|
||||
public DateTime? LastChange { get; set; }
|
||||
|
||||
|
||||
// --- Foreign Keys ---
|
||||
[Required]
|
||||
public required int TypeId { get; set; }
|
||||
|
||||
[Required]
|
||||
public required string CreatorId { get; set; }
|
||||
|
||||
|
||||
// --- Navigation Properties ---
|
||||
[ForeignKey(nameof(TypeId))]
|
||||
public virtual MediaType MediaType { get; set; } = null!;
|
||||
|
||||
[ForeignKey(nameof(CreatorId))]
|
||||
public virtual ApplicationUser User { get; set; } = null!;
|
||||
|
||||
public virtual ICollection<LinkTableGlobalGenre> LinkTableGlobalGenres { get; set; } = new List<LinkTableGlobalGenre>();
|
||||
|
||||
public virtual ICollection<PrivateEntity> PrivateEntities { get; set; } = new List<PrivateEntity>();
|
||||
|
||||
public virtual ICollection<SharedListEntity> SharedListEntities { get; set; } = new List<SharedListEntity>();
|
||||
}
|
||||
}
|
||||
24
WatchLog/Data/DatabaseModels/Global/LinkTableGlobalGenre.cs
Normal file
24
WatchLog/Data/DatabaseModels/Global/LinkTableGlobalGenre.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace WatchLog.Data
|
||||
{
|
||||
[PrimaryKey(nameof(GlobalEntityId), nameof(GenreId))]
|
||||
public class LinkTableGlobalGenre
|
||||
{
|
||||
// --- Foreign Keys ---
|
||||
[Column(Order = 0)]
|
||||
public int GlobalEntityId { get; set; }
|
||||
|
||||
[Column(Order = 1)]
|
||||
public int GenreId { get; set; }
|
||||
|
||||
|
||||
// --- Navigation Properties ---
|
||||
[ForeignKey(nameof(GlobalEntityId))]
|
||||
public virtual GlobalEntity GlobalEntity { get; set; } = null!;
|
||||
|
||||
[ForeignKey(nameof(GenreId))]
|
||||
public virtual Genre Genre { get; set; } = null!;
|
||||
}
|
||||
}
|
||||
18
WatchLog/Data/DatabaseModels/Global/MediaType.cs
Normal file
18
WatchLog/Data/DatabaseModels/Global/MediaType.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace WatchLog.Data
|
||||
{
|
||||
public class MediaType
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(50)]
|
||||
public required string Name { get; set; }
|
||||
|
||||
|
||||
// --- Navigation Property ---
|
||||
public virtual ICollection<GlobalEntity> GlobalEntities { get; set; } = new List<GlobalEntity>();
|
||||
}
|
||||
}
|
||||
22
WatchLog/Data/DatabaseModels/Global/StreamingPlatform.cs
Normal file
22
WatchLog/Data/DatabaseModels/Global/StreamingPlatform.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace WatchLog.Data
|
||||
{
|
||||
public class StreamingPlatform
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(100)]
|
||||
public required string Name { get; set; }
|
||||
|
||||
[Required]
|
||||
public string? PicturePath { get; set; }
|
||||
|
||||
[Required]
|
||||
public required DateTime CreationTime { get; set; }
|
||||
|
||||
public DateTime? LastChange { get; set; }
|
||||
}
|
||||
}
|
||||
32
WatchLog/Data/DatabaseModels/Private/Label.cs
Normal file
32
WatchLog/Data/DatabaseModels/Private/Label.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace WatchLog.Data
|
||||
{
|
||||
public class Label
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(50)]
|
||||
public required string Name { get; set; }
|
||||
|
||||
[Required]
|
||||
public required DateTime CreationTime { get; set; }
|
||||
|
||||
public DateTime? LastChange { get; set; }
|
||||
|
||||
|
||||
// --- Foreign Key ---
|
||||
[Required]
|
||||
public string? CreatorId { get; set; }
|
||||
|
||||
|
||||
// --- Navigation Properties ---
|
||||
[ForeignKey(nameof(CreatorId))]
|
||||
public virtual ApplicationUser User { get; set; } = null!;
|
||||
|
||||
public virtual ICollection<LinkTablePrivateLabel> LinkTablePrivateLabels { get; set; } = new List<LinkTablePrivateLabel>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace WatchLog.Data
|
||||
{
|
||||
[PrimaryKey(nameof(PrivateEntityId), nameof(LabelId))]
|
||||
public class LinkTablePrivateLabel
|
||||
{
|
||||
// --- Foreign Keys ---
|
||||
public int PrivateEntityId { get; set; }
|
||||
public int LabelId { get; set; }
|
||||
|
||||
|
||||
// --- Navigation Properties ---
|
||||
[ForeignKey(nameof(PrivateEntityId))]
|
||||
public virtual PrivateEntity PrivateEntity { get; set; } = null!;
|
||||
|
||||
[ForeignKey(nameof(LabelId))]
|
||||
public virtual Label Label { get; set; } = null!;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace WatchLog.Data
|
||||
{
|
||||
[PrimaryKey(nameof(PrivateEntityId), nameof(StreamingPlatformId))]
|
||||
public class LinkTablePrivateStreamingPlatform
|
||||
{
|
||||
// --- Foreign Keys ---
|
||||
public int PrivateEntityId { get; set; }
|
||||
public int StreamingPlatformId { get; set; }
|
||||
|
||||
|
||||
// --- Navigation Properties ---
|
||||
[ForeignKey(nameof(PrivateEntityId))]
|
||||
public virtual PrivateEntity PrivateEntity { get; set; } = null!;
|
||||
|
||||
[ForeignKey(nameof(StreamingPlatformId))]
|
||||
public virtual StreamingPlatform StreamingPlatform { get; set; } = null!;
|
||||
}
|
||||
}
|
||||
52
WatchLog/Data/DatabaseModels/Private/PrivateEntity.cs
Normal file
52
WatchLog/Data/DatabaseModels/Private/PrivateEntity.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace WatchLog.Data
|
||||
{
|
||||
public class PrivateEntity
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
|
||||
public bool Favorite { get; set; } = false;
|
||||
|
||||
[MaxLength(1000)]
|
||||
public string? Description { get; set; }
|
||||
|
||||
public int? Season { get; set; }
|
||||
|
||||
public int? Episode { get; set; }
|
||||
|
||||
public int? Rating { get; set; }
|
||||
|
||||
[Required]
|
||||
public required DateTime CreationTime { get; set; }
|
||||
|
||||
public DateTime? LastChange { get; set; }
|
||||
|
||||
|
||||
// --- Foreign Keys ---
|
||||
[Required]
|
||||
public string? UserId { get; set; }
|
||||
|
||||
[Required]
|
||||
public int GlobalEntityId { get; set; }
|
||||
|
||||
public int? UserWatchStatusId { get; set; }
|
||||
|
||||
|
||||
// --- Navigation Properties ---
|
||||
[ForeignKey(nameof(UserId))]
|
||||
public virtual ApplicationUser User { get; set; } = null!;
|
||||
|
||||
[ForeignKey(nameof(GlobalEntityId))]
|
||||
public virtual GlobalEntity GlobalEntity { get; set; } = null!;
|
||||
|
||||
[ForeignKey(nameof(UserWatchStatusId))]
|
||||
public virtual UserWatchStatus? UserWatchStatus { get; set; }
|
||||
|
||||
public virtual ICollection<LinkTablePrivateLabel> PrivateEntityLabels { get; set; } = new List<LinkTablePrivateLabel>();
|
||||
|
||||
public virtual ICollection<LinkTablePrivateStreamingPlatform> PrivateStreamingPlatforms { get; set; } = new List<LinkTablePrivateStreamingPlatform>();
|
||||
}
|
||||
}
|
||||
38
WatchLog/Data/DatabaseModels/Private/UserWatchStatus.cs
Normal file
38
WatchLog/Data/DatabaseModels/Private/UserWatchStatus.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace WatchLog.Data
|
||||
{
|
||||
public class UserWatchStatus
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(50)]
|
||||
public required string Name { get; set; }
|
||||
|
||||
[MaxLength(255)]
|
||||
public string? Description { get; set; }
|
||||
|
||||
[MaxLength(7)]
|
||||
public string? ColorCode { get; set; }
|
||||
|
||||
[Required]
|
||||
public required DateTime CreationTime { get; set; }
|
||||
|
||||
public DateTime? LastChange { get; set; }
|
||||
|
||||
|
||||
// --- Foreign Key ---
|
||||
[Required]
|
||||
public string? UserId { get; set; }
|
||||
|
||||
|
||||
// --- Navigation Properties ---
|
||||
[ForeignKey(nameof(UserId))]
|
||||
public virtual ApplicationUser User { get; set; } = null!;
|
||||
|
||||
public virtual ICollection<PrivateEntity> PrivateEntities { get; set; } = new List<PrivateEntity>();
|
||||
}
|
||||
}
|
||||
22
WatchLog/Data/DatabaseModels/Shared/LinkTableSharedLabel.cs
Normal file
22
WatchLog/Data/DatabaseModels/Shared/LinkTableSharedLabel.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace WatchLog.Data
|
||||
{
|
||||
[PrimaryKey(nameof(SharedListLabelId), nameof(SharedListEntityId))]
|
||||
public class LinkTableSharedLabel
|
||||
{
|
||||
// --- Foreign Keys ---
|
||||
public int SharedListLabelId { get; set; }
|
||||
|
||||
public int SharedListEntityId { get; set; }
|
||||
|
||||
|
||||
// --- Navigation Properties ---
|
||||
[ForeignKey(nameof(SharedListLabelId))]
|
||||
public virtual SharedListLabel SharedListLabel { get; set; } = null!;
|
||||
|
||||
[ForeignKey(nameof(SharedListEntityId))]
|
||||
public virtual SharedListEntity SharedListEntity { get; set; } = null!;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace WatchLog.Data
|
||||
{
|
||||
[PrimaryKey(nameof(SharedListEnityId), nameof(StreamingPlatformId))]
|
||||
public class LinkTableSharedStreamingPlatform
|
||||
{
|
||||
// --- Foreign Keys ---
|
||||
public int SharedListEnityId { get; set; }
|
||||
public int StreamingPlatformId { get; set; }
|
||||
|
||||
|
||||
// --- Navigation Properties ---
|
||||
[ForeignKey(nameof(SharedListEnityId))]
|
||||
public virtual SharedListEntity SharedListEntity { get; set; } = null!;
|
||||
|
||||
[ForeignKey(nameof(StreamingPlatformId))]
|
||||
public virtual StreamingPlatform StreamingPlatform { get; set; } = null!;
|
||||
}
|
||||
}
|
||||
21
WatchLog/Data/DatabaseModels/Shared/LinkTableSharedUser.cs
Normal file
21
WatchLog/Data/DatabaseModels/Shared/LinkTableSharedUser.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace WatchLog.Data
|
||||
{
|
||||
[PrimaryKey(nameof(SharedListId), nameof(UserId))]
|
||||
public class LinkTableSharedUser
|
||||
{
|
||||
// --- Foreign Keys ---
|
||||
public int SharedListId { get; set; }
|
||||
public string? UserId { get; set; }
|
||||
|
||||
|
||||
// --- Navigation Properties ---
|
||||
[ForeignKey(nameof(SharedListId))]
|
||||
public virtual SharedList SharedList { get; set; } = null!;
|
||||
|
||||
[ForeignKey(nameof(UserId))]
|
||||
public virtual ApplicationUser User { get; set; } = null!;
|
||||
}
|
||||
}
|
||||
32
WatchLog/Data/DatabaseModels/Shared/SharedList.cs
Normal file
32
WatchLog/Data/DatabaseModels/Shared/SharedList.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace WatchLog.Data
|
||||
{
|
||||
public class SharedList
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(150)]
|
||||
public required string Name { get; set; }
|
||||
|
||||
[Required]
|
||||
public required DateTime CreationTime { get; set; }
|
||||
|
||||
public DateTime? LastChange { get; set; }
|
||||
|
||||
|
||||
// --- Navigation Properties ---
|
||||
public virtual ICollection<LinkTableSharedUser> SharedListUsers { get; set; } = new List<LinkTableSharedUser>();
|
||||
|
||||
public virtual ICollection<SharedListEntity> SharedListEntities { get; set; } = new List<SharedListEntity>();
|
||||
|
||||
public virtual ICollection<SharedWatchStatus> SharedWatchStatuses { get; set; } = new List<SharedWatchStatus>();
|
||||
|
||||
public virtual ICollection<SharedListLabel> SharedListLabels { get; set; } = new List<SharedListLabel>();
|
||||
}
|
||||
}
|
||||
49
WatchLog/Data/DatabaseModels/Shared/SharedListEntity.cs
Normal file
49
WatchLog/Data/DatabaseModels/Shared/SharedListEntity.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace WatchLog.Data
|
||||
{
|
||||
public class SharedListEntity
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
|
||||
public bool Favorite { get; set; } = false;
|
||||
|
||||
[MaxLength(1000)]
|
||||
public string? Description { get; set; }
|
||||
|
||||
public int? Season { get; set; }
|
||||
|
||||
public int? Episode { get; set; }
|
||||
|
||||
[Required]
|
||||
public required DateTime CreationTime { get; set; }
|
||||
|
||||
public DateTime? LastChange { get; set; }
|
||||
|
||||
|
||||
// --- Foreign Keys ---
|
||||
public int SharedListId { get; set; }
|
||||
|
||||
public int GlobalEntityId { get; set; }
|
||||
|
||||
public int? SharedWatchStatusId { get; set; }
|
||||
|
||||
|
||||
// --- Navigation Properties ---
|
||||
[ForeignKey(nameof(SharedListId))]
|
||||
public virtual SharedList SharedList { get; set; } = null!;
|
||||
|
||||
[ForeignKey(nameof(GlobalEntityId))]
|
||||
public virtual GlobalEntity GlobalEntity { get; set; } = null!;
|
||||
|
||||
[ForeignKey(nameof(SharedWatchStatusId))]
|
||||
public virtual SharedWatchStatus? SharedWatchStatus { get; set; }
|
||||
|
||||
public virtual ICollection<LinkTableSharedLabel> LinkTableSharedLabels { get; set; } = new List<LinkTableSharedLabel>();
|
||||
|
||||
public virtual ICollection<LinkTablePrivateStreamingPlatform> LinkTablePrivateStreamingPlatforms { get; set; } = new List<LinkTablePrivateStreamingPlatform>();
|
||||
}
|
||||
}
|
||||
37
WatchLog/Data/DatabaseModels/Shared/SharedListLabel.cs
Normal file
37
WatchLog/Data/DatabaseModels/Shared/SharedListLabel.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace WatchLog.Data
|
||||
{
|
||||
public class SharedListLabel
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(50)]
|
||||
public required string Name { get; set; }
|
||||
|
||||
[Required]
|
||||
public required DateTime CreationTime { get; set; }
|
||||
|
||||
public DateTime? LastChange { get; set; }
|
||||
|
||||
|
||||
// --- Foreign Key ---
|
||||
[Required]
|
||||
public int SharedListId { get; set; }
|
||||
|
||||
|
||||
// --- Navigation Properties ---
|
||||
[ForeignKey(nameof(SharedListId))]
|
||||
public virtual SharedList SharedList { get; set; } = null!;
|
||||
|
||||
public virtual ICollection<LinkTableSharedLabel> LinkTableSharedLabels { get; set; } = new List<LinkTableSharedLabel>();
|
||||
}
|
||||
}
|
||||
43
WatchLog/Data/DatabaseModels/Shared/SharedWatchStatus.cs
Normal file
43
WatchLog/Data/DatabaseModels/Shared/SharedWatchStatus.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace WatchLog.Data
|
||||
{
|
||||
public class SharedWatchStatus
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(50)]
|
||||
public required string Name { get; set; }
|
||||
|
||||
[MaxLength(255)]
|
||||
public string? Description { get; set; }
|
||||
|
||||
[MaxLength(7)]
|
||||
public string? ColorCode { get; set; }
|
||||
|
||||
[Required]
|
||||
public required DateTime CreationTime { get; set; }
|
||||
|
||||
public DateTime? LastChange { get; set; }
|
||||
|
||||
|
||||
// --- Foreign Key ---
|
||||
[Required]
|
||||
public int SharedListId { get; set; }
|
||||
|
||||
|
||||
// --- Navigation Properties ---
|
||||
[ForeignKey(nameof(SharedListId))]
|
||||
public virtual SharedList SharedList { get; set; } = null!;
|
||||
|
||||
public virtual ICollection<SharedListEntity> SharedListEntities { get; set; } = new List<SharedListEntity>();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user