示例#1
0
 private void RenameIndexes(IMutableEntityType entity)
 {
     foreach (var index in entity.GetIndexes())
     {
         index.SetName(_renameFunc(index.GetName()));
     }
 }
示例#2
0
        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();
     }
 }
示例#4
0
 private static void ConvertIndexNames(IMutableEntityType entity)
 {
     foreach (var index in entity.GetIndexes())
     {
         index.SetName(index.GetName().ToSnakeCase());
     }
 }