Files
Core_Be/Models/GymRolePermission.cs
Dhananjaya99 bffc9b1686 first commit
2026-09-28 11:44:26 +05:30

21 lines
842 B
C#

using System.ComponentModel.DataAnnotations.Schema;
namespace Fitness_core_BE.Models
{
// Join row: a GymRole is granted access to one NavItem/permission key.
// Composite key (FKGymRoleId, NavItemKey) is configured in TenantDbContext.OnModelCreating.
public class GymRolePermission
{
public Guid FKGymRoleId { get; set; }
[ForeignKey("FKGymRoleId")]
public virtual GymRole GymRole { get; set; }
// NavItem is central-bucket (global nav catalog); this FK is a plain scalar in
// TenantDbContext (see Ignore config there) -- resolve the label from NavItemKey
// against CentralDbContext.NavItems when actually needed.
public string NavItemKey { get; set; } = string.Empty;
[ForeignKey("NavItemKey")]
public virtual NavItem NavItem { get; set; }
}
}