transactions
This commit is contained in:
25
back/persistance/data/relations/RoleContext.cs
Normal file
25
back/persistance/data/relations/RoleContext.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
//using back.DataModels;
|
||||
//using Microsoft.EntityFrameworkCore;
|
||||
|
||||
//namespace back.persistance.data.relations;
|
||||
|
||||
|
||||
//public class RoleContext : DbContext
|
||||
//{
|
||||
// protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
// {
|
||||
// // Role -> Permissions (muchos-a-muchos)
|
||||
// modelBuilder.Entity<Role>()
|
||||
// .HasMany(r => r.Permissions)
|
||||
// .WithMany(p => p.Roles)
|
||||
// .UsingEntity(j => j.ToTable("RolePermissions"));
|
||||
|
||||
// // Role -> BaseRole (auto-referencial)
|
||||
// modelBuilder.Entity<Role>()
|
||||
// .HasOne(r => r.BaseRoleModel)
|
||||
// .WithMany() // Un rol base puede ser heredado por múltiples roles
|
||||
// .HasForeignKey(r => r.BaseRoleModelId);
|
||||
|
||||
// base.OnModelCreating(modelBuilder);
|
||||
// }
|
||||
//}
|
Reference in New Issue
Block a user