设为首页 加入收藏

TOP

Entity Framework工具POCO Code First Generator的使用(三)
2017-10-10 13:49:37 】 浏览:10041
Tags:Entity Framework 工具 POCO Code First Generator 使用
eDataAnnotations = true;
// It is used to set a data annotation on a column based on the columns name. // Make sure the column name is lowercase in the following array, regardless of how it is in the database // Column name DataAnnotation to add { "email", "EmailAddress" }, { "emailaddress", "EmailAddress" }, { "creditcard", "CreditCard" }, { "url", "Url" }, { "phone", "Phone" }, { "phonenumber", "Phone" }, { "mobile", "Phone" }, { "mobilenumber", "Phone" }, { "telephone", "Phone" }, { "telephonenumber", "Phone" }, { "password", "DataType(DataType.Password)" }, { "username", "DataType(DataType.Text)" } }; // Migrations ************************************************************************************************************************* MigrationConfigurationFileName = ""; // null or empty to not create migrations MigrationStrategy = "MigrateDatabaseToLatestVersion"; // MigrateDatabaseToLatestVersion, CreateDatabaseIfNotExists or DropCreateDatabaseIfModelChanges ContextKey = ""; // Sets the string used to distinguish migrations belonging to this configuration from migrations belonging to other configurations using the same database. This property enables migrations from multiple different models to be applied to applied to a single database. AutomaticMigrationsEnabled = true; AutomaticMigrationDataLossAllowed = true; // if true, can drop fields and lose data during automatic migration // Pluralization ********************************************************************************************************************** // To turn off pluralization, use: // Inflector.PluralizationService = null; // Default pluralization, use: // Inflector.PluralizationService = new EnglishPluralizationService(); // For Spanish pluralization: // 1. Intall the "EF6.Contrib" Nuget Package. // 2. Add the following to the top of this file and adjust path, and remove the space between the angle bracket and # at the beginning and end. // < #@ assembly name="your full path to \EntityFramework.Contrib.dll" # > // 3. Change the line below to: Inflector.PluralizationService = new SpanishPluralizationService(); Inflector.PluralizationService = new EnglishPluralizationService(); // If pluralisation does not do the right thing, override it here by adding in a custom entry. //Inflector.PluralizationService = new EnglishPluralizationService(new[] //{ // // Create custom ("Singular", "Plural") forms for one-off words as needed. // new CustomPluralizationEntry("Course", "Courses"), // new CustomPluralizationEntry("Status", "Status") // Use same value to prevent pluralisation //}); // Elements to generate *************************************************************************************************************** // Add the elements that should be generated when the template is executed. // Multiple projects can now be used that separate the different concerns. ElementsToGenerate = Elements.Poco | Elements.Context | Elements.UnitOfWork | Elements.PocoConfiguration; // Use t
首页 上一页 1 2 3 4 5 6 7 下一页 尾页 3/9/9
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇asp.net MVC 上传文件 System.Web.. 下一篇Wpf TemplateBinding

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目