I have a many-to-many relationship from user and role, indicated by this excerpt from the EntityTypeConfiguration<Role> derived class, which allows me to specify schemas for individual tables, for example:
[Schema(SchemaNames.ParkPay)] class WeekDayConfig : EntityTypeConfigurationWithSchema<WeekDay> { internal WeekDayConfig() { Ignore(t => t.IsDeleted); Property(p => p.Name) .IsRequired() .HasMaxLength(20); } }
Now, for Role , the configuration class contains this code, and the resulting UserRole table is created within the "dbo" schema, and not in my desired schema. This is the code:
[Schema(SchemaNames.ParkPay)] internal class RoleConfig : EntityTypeConfigurationWithSchema<Role> { public RoleConfig() { HasMany(t => t.Users) .WithMany(t => t.Roles) .Map(m => { m.ToTable("UserRole"); m.MapLeftKey("RoleId"); m.MapRightKey("UserId"); }); } }
Is there anything I can do other than a script for changing the circuit during the seed initialization phase to have a UserRole table created using the parkpay scheme, and not the dbo scheme?
Profk source share