设为首页 加入收藏

TOP

Entity Framework工具POCO Code First Generator的使用(四)
2017-10-10 13:49:37 】 浏览:10042
Tags:Entity Framework 工具 POCO Code First Generator 使用
hese namespaces to specify where the different elements now live. These may even be in different assemblies.
// Please note this does not create the files in these locations, it only adds a using statement to say where they are. // The way to do this is to add the "EntityFramework Reverse POCO Code First Generator" into each of these folders. // Then set the .tt to only generate the relevant section you need by setting // ElementsToGenerate = Elements.Poco; in your Entity folder, // ElementsToGenerate = Elements.Context | Elements.UnitOfWork; in your Context folder, // ElementsToGenerate = Elements.PocoConfiguration; in your Maps folder. // PocoNamespace = "YourProject.Entities"; // ContextNamespace = "YourProject.Context"; // UnitOfWorkNamespace = "YourProject.Context"; // PocoConfigurationNamespace = "YourProject.Maps"; // You also need to set the following to the namespace where they now live: PocoNamespace = ""; ContextNamespace = ""; UnitOfWorkNamespace = ""; PocoConfigurationNamespace = ""; // Schema ***************************************************************************************************************************** // If there are multiple schemas, then the table name is prefixed with the schema, except for dbo. // Ie. dbo.hello will be Hello. // abc.hello will be AbcHello. PrependSchemaName = true; // Control if the schema name is prepended to the table name // Table Suffix *********************************************************************************************************************** // Prepends the suffix to the generated classes names // Ie. If TableSuffix is "Dto" then Order will be OrderDto // If TableSuffix is "Entity" then Order will be OrderEntity TableSuffix = null; // Filtering ************************************************************************************************************************** // Use the following table/view name regex filters to include or exclude tables/views // Exclude filters are checked first and tables matching filters are removed. // * If left null, none are excluded. // * If not null, any tables matching the regex are excluded. // Include filters are checked second. // * If left null, all are included. // * If not null, only the tables matching the regex are included. // For clarity: if you want to include all the customer tables, but not the customer billing tables. // TableFilterInclude = new Regex("^[Cc]ustomer.*"); // This includes all the customer and customer billing tables // TableFilterExclude = new Regex(".*[Bb]illing.*"); // This excludes all the billing tables // // Example: TableFilterExclude = new Regex(".*auto.*"); // TableFilterInclude = new Regex("(.*_FR_.*)|(data_.*)"); // TableFilterInclude = new Regex("^table_name1$|^table_name2$|etc"); // ColumnFilterExclude = new Regex("^FK_.*$"); SchemaFilterExclude = null; SchemaFilterInclude = null; TableFilterExclude = null; TableFilterInclude = null; ColumnFilterExclude = null; // Filtering of tables 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 table, return false to exclude it. TableFilter = (Table t) => { // Example: Exclude any table in dbo sche
首页 上一页 1 2 3 4 5 6 7 下一页 尾页 4/9/9
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇asp.net MVC 上传文件 System.Web.. 下一篇Wpf TemplateBinding

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目