123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- using Microsoft.EntityFrameworkCore;
- using Luticate2.Auth.DataAccess.Models;
-
- namespace Luticate2.Auth.DataAccess
- {
- public partial class LuDatabaseContext : DbContext
- {
- public LuDatabaseContext(DbContextOptions options) :base(options)
- {
- }
-
- protected override void OnModelCreating(ModelBuilder modelBuilder)
- {
-
- modelBuilder.Entity<lu_authentication_sources>()
- .HasKey(c => new { c.id });
-
-
- modelBuilder.Entity<lu_groups>()
- .HasKey(c => new { c.id });
-
-
- modelBuilder.Entity<lu_users>()
- .HasKey(c => new { c.id });
-
- modelBuilder.Entity<lu_users>()
- .HasOne(e => e.fk_lu_authentication_sources)
- .WithMany(e => e.lu_users_fk)
- .HasForeignKey("authentication_source_id")
- .HasConstraintName("lu_users_authentication_source_id_fkey");
-
-
- modelBuilder.Entity<lu_verb_users_groups>()
- .HasKey(c => new { c.user_id, c.group_id });
-
- modelBuilder.Entity<lu_verb_users_groups>()
- .HasOne(e => e.fk_lu_users)
- .WithMany(e => e.lu_verb_users_groups_fk)
- .HasForeignKey("user_id")
- .HasConstraintName("lu_verb_users_groups_user_id_fkey");
-
- modelBuilder.Entity<lu_verb_users_groups>()
- .HasOne(e => e.fk_lu_groups)
- .WithMany(e => e.lu_verb_users_groups_fk)
- .HasForeignKey("group_id")
- .HasConstraintName("lu_verb_users_groups_group_id_fkey");
-
-
- }
-
- public DbSet<lu_authentication_sources> lu_authentication_sources { get; set; }
-
- public DbSet<lu_groups> lu_groups { get; set; }
-
- public DbSet<lu_users> lu_users { get; set; }
-
- public DbSet<lu_verb_users_groups> lu_verb_users_groups { get; set; }
-
- }
- }
|