Adds Database Structure in C# with Entity Framework
This commit is contained in:
22
WatchLog/Data/Database/Shared/LinkTableSharedLabel.cs
Normal file
22
WatchLog/Data/Database/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!;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user