Files
MilkyShots/Lactose/Models/PersonMaintainer.cs
REDCODE 674710986f fix(model): add [PrimaryKey] annotation to PersonMaintainer for clarity
Composite key (PersonId, UserId) was only defined via Fluent API;
[PrimaryKey] makes the model class self-documenting.
2026-07-14 20:33:18 +02:00

33 lines
902 B
C#

using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Lactose.Models;
/// <summary>
/// Represents the many-to-many relationship between maintainer users and the cosplayers they maintain.
/// </summary>
[PrimaryKey(nameof(PersonId), nameof(UserId))]
public class PersonMaintainer {
/// <summary>
/// Gets or sets the person (cosplayer) ID.
/// </summary>
[ForeignKey(nameof(Person))]
public Guid PersonId { get; set; }
/// <summary>
/// Gets or sets the person (cosplayer).
/// </summary>
public Person Person { get; set; } = null!;
/// <summary>
/// Gets or sets the maintainer user ID.
/// </summary>
[ForeignKey(nameof(User))]
public Guid UserId { get; set; }
/// <summary>
/// Gets or sets the maintainer user.
/// </summary>
public User User { get; set; } = null!;
}