private void RenameIndexes(IMutableEntityType entity) { foreach (var index in entity.GetIndexes()) { index.SetName(_renameFunc(index.GetName())); } }
private static void NamesToSnakeCase(IMutableEntityType entity) { // Replace table names entity.SetTableName(entity.GetTableName().ToLower()); // Replace column names foreach (var property in entity.GetProperties()) { property.SetColumnName(property.Name.ToLower()); } foreach (var key in entity.GetKeys()) { key.SetName(key.GetName().ToLower()); } foreach (var key in entity.GetForeignKeys()) { key.SetConstraintName(key.GetConstraintName().ToLower()); } foreach (var index in entity.GetIndexes()) { index.SetName(index.GetName().ToLower()); } }
/// <summary> /// Underscores index names for the given IMutableEntityType. /// </summary> /// <param name="entity"></param> public static void UnderscoreIndices(this IMutableEntityType entity) { foreach (var index in entity.GetIndexes()) { index.Relational().Name = index.Relational().Name.Underscore(); } }
private static void ConvertIndexNames(IMutableEntityType entity) { foreach (var index in entity.GetIndexes()) { index.SetName(index.GetName().ToSnakeCase()); } }