This commit is contained in:
@@ -52,7 +52,6 @@ namespace AyaNova.Models
|
||||
}
|
||||
else
|
||||
property.Relational().ColumnName = property.Name.ToLowerInvariant();
|
||||
|
||||
}
|
||||
|
||||
foreach (var key in entity.GetKeys())
|
||||
@@ -69,21 +68,21 @@ namespace AyaNova.Models
|
||||
{
|
||||
index.Relational().Name = index.Relational().Name.ToLowerInvariant();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//Indexes must be specified through fluent api unfortunately
|
||||
modelBuilder.Entity<FileAttachment>().HasIndex(p => p.StoredFileName);
|
||||
|
||||
|
||||
//Relationships
|
||||
modelBuilder.Entity<Locale>()
|
||||
.HasMany(c => c.LocaleItems)
|
||||
.WithOne(e => e.Locale)
|
||||
.IsRequired();//default delete behaviour is cascade when set to isrequired
|
||||
|
||||
|
||||
modelBuilder.Entity<User>()
|
||||
.HasOne(p => p.UserOptions)
|
||||
.WithOne(i => i.User)
|
||||
.HasForeignKey<UserOptions>(b => b.UserId);
|
||||
|
||||
|
||||
//-----------
|
||||
|
||||
Reference in New Issue
Block a user