设为首页 加入收藏

TOP

Entity Framework工具POCO Code First Generator的使用(五)
2017-10-10 13:49:37 】 浏览:10052
Tags:Entity Framework 工具 POCO Code First Generator 使用
ma with "order" in its name.
//if(t.Schema.Equals("dbo", StringComparison.InvariantCultureIgnoreCase) && t.NameHumanCase.ToLowerInvariant().Contains("order")) // return false; return true; }; // Stored Procedures ****************************************************************************************************************** // Use the following regex filters to include or exclude stored procedures StoredProcedureFilterExclude = null; StoredProcedureFilterInclude = null; // Filtering of stored procedures using a function. This can be used in conjunction with the Regex's above. // Regex are used first to filter the list down, then this function is run last. // Return true to include the stored procedure, return false to exclude it. StoredProcedureFilter = (StoredProcedure sp) => { // Example: Exclude any stored procedure in dbo schema with "order" in its name. //if(sp.Schema.Equals("dbo", StringComparison.InvariantCultureIgnoreCase) && sp.NameHumanCase.ToLowerInvariant().Contains("order")) // return false; return true; }; // Table renaming ********************************************************************************************************************* // Use the following function to rename tables such as tblOrders to Orders, Shipments_AB to Shipments, etc. // Example: TableRename = (string name, string schema, bool isView) => { // Example //if (name.StartsWith("tbl")) // name = name.Remove(0, 3); //name = name.Replace("_AB", ""); //if(isView) // name = name + "View"; // If you turn pascal casing off (UsePascalCase = false), and use the pluralisation service, and some of your // tables names are all UPPERCASE, some words ending in IES such as CATEGORIES get singularised as CATEGORy. // Therefore you can make them lowercase by using the following // return Inflector.MakeLowerIfAllCaps(name); // If you are using the pluralisation service and you want to rename a table, make sure you rename the table to the plural form. // For example, if the table is called Treez (with a z), and your pluralisation entry is // new CustomPluralizationEntry("Tree", "Trees") // Use this TableRename function to rename Treez to the plural (not singular) form, Trees: // if (name == "Treez") return "Trees"; return name; }; // Column modification***************************************************************************************************************** // Use the following list to replace column byte types with Enums. // As long as the type can be mapped to your new type, all is well. //EnumsDefinitions.Add(new EnumDefinition { Schema = "dbo", Table = "match_table_name", Column = "match_column_name", EnumType = "name_of_enum" }); //EnumsDefinitions.Add(new EnumDefinition { Schema = "dbo", Table = "OrderHeader", Column = "OrderStatus", EnumType = "OrderStatusType" }); // This will replace OrderHeader.OrderStatus type to be an OrderStatusType enum // Use the following function if you need to apply additional modifications to a column // eg. normalise names etc. UpdateColumn = (Column column, Table table) => { // Rename column //if (column.IsPrimaryKey && column.NameHumanCase == "PkId") // colu
首页 上一页 2 3 4 5 6 7 8 下一页 尾页 5/9/9
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇asp.net MVC 上传文件 System.Web.. 下一篇Wpf TemplateBinding

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目