public void AdjustUserLoginKey() { var tenant1 = new TenantInfo { Id = "abc", Identifier = "abc", Name = "abc", ConnectionString = "DataSource=testDb.db" }; using var c = new TestIdentityDbContext(tenant1); Assert.True(c.Model.FindEntityType(typeof(IdentityUserLogin <string>))?.FindProperty("Id")? .IsPrimaryKey()); }
public void AdjustRoleIndex() { var tenant1 = new TenantInfo { Id = "abc", Identifier = "abc", Name = "abc", ConnectionString = "DataSource=testDb.db" }; using var c = new TestIdentityDbContext(tenant1); var props = new List <IProperty> { c.Model.FindEntityType(typeof(IdentityRole))?.FindProperty("NormalizedName") !, c.Model.FindEntityType(typeof(IdentityRole))?.FindProperty("TenantId") ! }; var index = c.Model.FindEntityType(typeof(IdentityRole))?.FindIndex(props); Assert.NotNull(index); Assert.True(index !.IsUnique); }
public void AddUserLoginIndex() { var tenant1 = new TenantInfo { Id = "abc", Identifier = "abc", Name = "abc", ConnectionString = "DataSource=testDb.db" }; using var c = new TestIdentityDbContext(tenant1); var props = new List <IProperty> { c.Model.FindEntityType(typeof(IdentityUserLogin <string>))?.FindProperty("LoginProvider") !, c.Model.FindEntityType(typeof(IdentityUserLogin <string>))?.FindProperty("ProviderKey") !, c.Model.FindEntityType(typeof(IdentityUserLogin <string>))?.FindProperty("TenantId") ! }; var index = c.Model.FindEntityType(typeof(IdentityUserLogin <string>))?.FindIndex(props); Assert.NotNull(index); Assert.True(index !.IsUnique); }