Adds Database Structure in C# with Entity Framework
This commit is contained in:
32
WatchLog/Data/Database/Global/User.cs
Normal file
32
WatchLog/Data/Database/Global/User.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace WatchLog.Data
|
||||
{
|
||||
public class User
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(100)]
|
||||
public required string Name { get; set; }
|
||||
|
||||
[MaxLength(255)]
|
||||
public string? Email { get; set; }
|
||||
|
||||
[Required]
|
||||
public required string Password { get; set; } // Important: Save as HASH
|
||||
|
||||
|
||||
// --- Navigation Properties ---
|
||||
public virtual ICollection<PrivateEntity> PrivateEntities { get; set; } = new List<PrivateEntity>();
|
||||
|
||||
public virtual ICollection<GlobalEntity> GlobalEntities { get; set; } = new List<GlobalEntity>();
|
||||
|
||||
public virtual ICollection<Label> Labels { get; set; } = new List<Label>();
|
||||
|
||||
public virtual ICollection<UserWatchStatus> UserWatchStatuses { get; set; } = new List<UserWatchStatus>();
|
||||
|
||||
public virtual ICollection<LinkTableSharedUser> LinkTableSharedUsers { get; set; } = new List<LinkTableSharedUser>();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user