/// <summary> /// 获取DbFirst名称 /// </summary> /// <param name="task"></param> /// <returns></returns> public static string GetDbFirstName(this IBuilderTask task) { if (task.CurrentBuilder == null) { return(task.CurrentDbTable.Name); } var convert = new DefaultWordsConvert(task.CurrentBuilder.Mode); var convertName = convert.Convert(task.CurrentDbTable.Name); return($"{task.CurrentBuilder.Prefix}{convertName}{task.CurrentBuilder.Suffix}"); }
/// <summary> /// 获取CodeFirst名称 /// </summary> /// <param name="builder"></param> /// <param name="tableName"></param> /// <returns></returns> public static string GetName(this BuilderOptions builder, string tableName) { if (builder == null) { return(tableName); } var convert = new DefaultWordsConvert(builder.Mode); var convertName = convert.Convert(tableName); return($"{builder.Prefix}{convertName}{builder.Suffix}"); }
/// <summary> /// 通过转换器后的字段名 /// </summary> /// <param name="column"></param> /// <param name="name"></param> /// <returns></returns> public static string GetColumnName(this BuilderOptions column, string name) { var convert = new DefaultWordsConvert(column.Mode); return($"{column.Prefix}{convert.Convert(name)}{column.Suffix}"); }