45 lines
1.3 KiB
C#
45 lines
1.3 KiB
C#
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>();
|
|
}
|
|
} |