Adds Database Structure in C# with Entity Framework

This commit is contained in:
Henry Trumme
2025-04-22 00:59:47 +02:00
parent 370edc17e9
commit 1e6c7a47a4
71 changed files with 6197 additions and 140 deletions

View 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!;
}
}