Whats coming in the next release:
- { get; internal set; } for stored generated fields has been changed to { get; set; }. In some situations you may want to assign it manually, and another when serializing across a WCF service. The ID is lost when serializing because it was marked internal. Thanks to fjrodriguez.
Whats new in v2.12.3:
- Remove use of [GeneratedCodeAttribute] where not necessary.
- Case 108. Include the schema when calling stored procedures. Thanks to emdadgar2.
- Case 109. Nullable uniqueidentifier with default value generates exception. Thanks tomarkuspeter.
- Case 107. Stored procedure return column name tidy up could bring all Null value. Thanks todisanxian.
- Case 106. Add support for async methods. Thanks to youngcm2.
- Changed the stored procedure parameters to be nullable. Thanks to Suraj Ramalingam.
- Case 110. Do not remove stored procedure where it has no return fields. Thanks toemdadgar2.
Whats new in v2.12.1:
- Case 101. SQL Server compact connection string only looks in current project. It now looks in all project paths for the SDF file, in a similar way to finding the app.config file for the connection string.
- Much faster TableSQL. Query plan cost is 97% vs 3%. Thanks to Glenn Orr.
- Much faster ForeignKeySQL. Query plan cost is 71% vs 29%.
- Unique indexes are now checked for. Previously, for tables without primary keys, all the NOT NULL columns used to be marked as a primary key. Now, if the table has a unique index, these unique index columns are used instead. However, the columns are still checked for being NOT NULL as entity framework will not allow a primary key to be made up of a column which can be NULLable.
- MakeClassesPartial flag now adds partial keyword to the stored procedure model classes.
- Added AdditionalContextInterfaceItems array to allow adding of extra functions to the db context interface.
- Fix schema prepending for Stored Procedures. Thanks to Emanov.
- Fix bug in MigrationStrategy when set to CreateDatabaseIfNotExists or DropCreateDatabaseIfModelChanges. Thanks toWill.
- Case 102. Stored procedures with no input parameters and all columns are nullable views cannot get populated in .cs. Thanks todisanxian.
- Calls to stored procedures are now placed in [square brackets] in case there are spaces in its name.
- Case 103. Check for column name C# reserved word name clashes. Thanks to swago.
- Do not include foreign keys which use composite keys.
Whats new in v2.11.0:
- Case 61. Allow excluding/modifying columns. Also permits you to run a function against each column to optionally modify the column properties (eg. to tweak the name of the generated property etc). Thanks toDavid Gardiner.
- Case 99. Add ability to specify additional using namespaces. Thanks to rorourke.
- Case 100. Apply GeneratedCodeAttribute to generated code. Thanks to David Gardiner.
Whats new in v2.10.2:
- Case 93. Merge logic for foreignKey column matching, previously .col=null was possible. Thanks toAHewgill.
- StoredProcs that return nullable binary types generate invalid "ReturnModel" code. Thanks toWallyHDisplayName.
- Case 96. Add a default for getutcdate(). Thanks to mbargar13.
- Case 94. Missing "using DatabaseGeneratedOption = System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedOption;" when targeting Framework 4.5. Thanks toalexdeblasis.
- StoredProcedureRename was being ignored. Thanks to slyCzar.
- Case 98. Corrected bridge table issue. Thanks to simooo985.
Whats new in v2.10.1:
- Stored Procedure arguments that are C# reserved keywords need escaping. Thanks toJimstr.
- Make mapping variables consistent during name clashes. An an edge case could cause different names for the reverse navigation as compared to the Map during name clashes. Thanks toFJRodriguez.
- Fix indentation when MakeClassesPartial is set.
Whats new in v2.10.0:
- Auto Migrations. To enable set MigrationConfigurationFileName to a class name, "MyDbContextDBMigrationConfiguration" for example. This enabled Entity Framework to update the schema when it is deployed in production. Thanks toFJRodriguez.
- Remove use of uses_native_compilation column in Stored Procedure SQL to support older database (< 2014). Thanks toNicholas Head.
Whats new in v2.9.1:
- GetSqlDbType was missing some types (nvarchar, and uniqueidentifier). Thanks toWally.
- Add in "using System.Linq" if Elements.StoredProcedures declared and not Elements.Context. Thanks toWally.
Whats new in v2.9.0:
- Stored procedure support !
- This includes the ability to retrieve the RESULT from stored procs, as well as the data. A result of 0 means success, any other value is an error.
- Include stubs for the stored procs in the FakeDbContext.
- Sort contents of HasForeignKey(...) by foreign key ordinal.
- Prevent creating maps where the left and right side of the map are the same table.
- Use a try/catch for WCF projects. Thanks to FJRodriguez.
- Include examples of CustomPluralizationEntry. Thanks to Carrie Kroutil.
- Allow for manual setting of the targeted .Net framework version.
Whats new in v2.8.3:
- Added new setting IncludeQueryTraceOn9481Flag so that you are now in control if "OPTION (QUERYTRACEON 9481)" is appended to the SQL. SqlServer 2014 is known to appear frozen / take a long time when this file is saved. If it does, set this to true (however you will also need elevated privileges).
- Added new setting DbContextBaseClass. You can now specify what the base class for your DbContext class is. For example ASP.NET Identity use "IdentityDbContext<ApplicationUser>", or even go so far as a custom: IdentityDbContext<CustomUser, CustomRole, int, CustomUserLogin, CustomUserRole, CustomUserClaim>. Thanks toParag Shravagi.
- Fixed bug: IndexOutOfRangeException thrown inside GetCurrentProject. Thanks toDavid Gardiner.
https://efreversepoco.codeplex.com/workitem/85
Whats new in v2.8.2:
- This update is required to fix a problem with Sql Server 2014 as it freezes when obtaining the Foreign Keys. See
here for more info. The solution was to add OPTION (QUERYTRACEON 9481). Thanks to@ErikEJ for the solution.
Using this option flag needs a higher SQL privilege, so you may experience:
User 'Your.Name' does not have permission to run DBCC TRACEON.
More info (requires sysadmin rights) http://spaghettidba.com/2013/02/08/using-querytraceon-in-plan-guides/
Whats new in v2.8.1:
- Bug fix: If property had _ appended, and is used as key, it breaks template generation. Thanks toNicholas Head.
Whats new in v2.8.0:
- Added a new flag: AddUnitTestingDbContext. If true, this will create a Fake DbContext and a FakeDbSet<T>. This will allow easy unit testing. Can't believe I never added this sooner. See the documentation Unit Testing.
Whats new in v2.7.0:
- Fixed bug: Missing schema specification in ManyToMany tables. Thanks to Vtanman & Snajahi.
- Add a timeout when obtaining the schema info from a slow database. Thanks to DotNetWise.
- Changed table renaming to use a function. Thanks to DotNetWise.
Whats new in v2.6.3:
- Add IsUnicode(false) for the char/varchar columns. Thanks to Naomi N.
- Rollback a feature added in 2.5.1: For database types such as Numeric(17,0), the C# type should resolve to something in the "int" family. Thanks toSimmered.
Whats new in v2.6.2:
- Include another namespace if Target framework is not 4.0. Thanks to NazmulRockOn.
- CR/LF in extended properties caused errors. Thanks to Simmered.
- Use IsFixedLength() for char/nchar types. Thanks to Naomi N.
Whats new in v2.6.1:
- Added the same extended properties comments facility for SQL CE. Thanks to @ErikEJ
Whats new in v2.6.0:
- It now reads the extended properties and can add them to the poco classes in comments. See the new IncludeExtendedPropertyComments flag which is an enumeration of
[Flags]
public enum ExtendedPropertyCommentsStyle
{
None,
InSummaryBlock,
AtEndOfField
};
- ExtendedPropertyCommentsStyle.None: No extended properties are shown.
- ExtendedPropertyCommentsStyle.InSummaryBlock: extended properties are shown above field in a ///<summary> block.
- ExtendedPropertyCommentsStyle.AtEndOfField: extended properties are shown at the end of the field in a comment block.
The IncludeComments flag is completely independent to IncludeExtendedPropertyComments.
If you want completely comment free generate code, set IncludeComments = false, and IncludeExtendedPropertyComments = ExtendedPropertyCommentsStyle.None;
Whats new in v2.5.1:
- Move the call to tables.SetPrimaryKeys(); higher up. This allows support of tables with no primary keys to be able to be used. Thanks toJaved.
- For database types such as Numeric(17,0), the C# type should resolve to something in the "int" family. Thanks tosimmered.
Whats new in v2.5.0:
- Added option to strip and alter table names. Such as tblOrders to Orders, AB_Shipments to Shipments, etc. See Table renaming section.
- Added ability to switch off the Pluralization service.
- Added ability to use other Pluralization services, such as the SpanishPluralizationService as provided in the "EF6.Contrib" Nuget Package. If you are to use the SpanishPluralizationService, add the following to the top of your database.tt
file:
<#@ assembly name="C:\<Your path here>\packages\EF6.Contrib.1.0.5\lib\net45\EntityFramework.Contrib.dll" #>
Changing the path to where your DLL is situated.
Whats new in v2.4.1:
- Fixed bug: When using .HasForeignKey(...) for multi-column keys, the columns should be listed in ordinal order. Thanks toScott Hodges.
Whats new in v2.4.0
- Removed use of System.Data.Entity.DLL from the installation template as it is no longer required for EF 6.
- Moved spatial types from System.Data.Spatial to System.Data.Entity.Spatial for EF 6.
- Singular names and camel casing configuration were accidentally combined by using the UseCamelCase boolean. Thanks toRune Gulbrandsen.
- Added new flag IncludeComments. This controls the generation of comments in the output.
- Fixed bug in constructor where a UNIQUEIDENTIFIER column had default value. Thanks togonglei.
Whats new in v2.3.2
- Singularize one-to-one Reverse Navigation. Thanks to StormRider.
- Bugfix for IsRowVersion() for timestamp columns. Thanks to StormRider.
- Do not append "m" to decimal value in poco ctor if default contains an unparsable value.
Whats new in v2.3.0:
- SQL Server Compact 4.0 support. Thanks to ErikEJ.
Whats new in v2.2.1:
- Add strings to be allowed as computed columns. Thanks to JBJBJB and BrhineScot.
- Now includes callbacks during code generation. This means you can add attributes to classes, specify a base class, specify custom code within the class, and finally a call back for each column within the class. Thanks toSimplyFoolish.
- OData doesn't support entities with geometery/geography types. Provided a flag to turn these off if entities are being generated from ODATA. Thanks toSimplyFoolish. Flag is called DisableGeographyTypes.
- Fixed bug with the Pluralisation service. If your current culture was not en, then it would throw an exception. Thanks toErikEJ.
Whats new in v2.2.0:
- Now uses the .Net Pluralization service. Thanks to James Manning.
- Bug fixed when you have foreign keys between two tables where the FK/PK columns have spaces in the column name. Thanks toColin Smith.
- Bug fixed. Solution Folders are not searched for config settings. Thanks to scaftw.
- Generate navigation property based on FK name. If there are two FK links to a table, the second link would appear as linkName1. This is now detected and both the FK properties will make use of the FK name. If only one FK is used, then the FK name is not appended to the table name. Thanks to saber_solomon.
- Sort the generated Reverse navigation and foriegn keys in POCO classes.
Whats new in v2.1.0:
- Fixed bug if default constraint was not in expected format. Thanks to Filipe Fujiy.
- Now detects name clashes with C# keywords.
- Added "System." to DateTime.Now(), etc to prevent clashes with table field names.
- "Configuration" class names are now configurable as "Mapping", "Map", etc.
- Added support for Spatial.DbGeometry and Spatial.DbGeography. Thanks to Simply Foolish andJorge Bustos.
- Can now have custom collection type for Navigation Properties. "ObservableCollection" for example. Thanks to Simply Foolish.
Whats new in v2.0:
- Fixed issue when running 'Transform All T4 Templates' from Visual Studio Build Menu.Thanks to JRoselle.
- Changing mappings during runtime is not possible/expensive. A specific DbModelBuilder can be used for each needed database schema.Thanks to meixger.
- Added ability to detect and use .IsRowVersion().
- Added many-to-many mappings. The generated code now includes calls to .Map(). Therefore the generated code will be different to what you had previously in v1 if you have many-to-many table mappings in your database. Hence the revision change to v2.0.0 as I'm using semantic versioning.
Whats new in v1.12:
- VARBINARY(MAX) is now correctly assigned to byte[]. Thanks to Luke91577.
- Extending partial class support. Allow specification of file extension for partial classes (i.e. ".generated.cs").Thanks to AB_dreeve.
- Fixes issues when targeting .NET 4. .NET 4.0 doesn't include the System.ComponentModel.DataAnnotations.Schema namespace, allow specification of TargetFrameworkVersion.Thanks to AB_dreeve.
Whats new in v1.11:
- Including views is now working. For a view to be included, at least one column must not be nullable.Thanks to Delmo Carruzzo.
- Added selective generation of components (Poco, Context, UnitOfWork, PocoConfiguration). You can now build entities in your Model project, and context, configuration, unit of work in your Data project. Thanks to kscelfo.
- Added PrependSchemaName flag. You can now control if the schema name is prepended to the table name. Thanks to kscelfo.
Whats new in v1.10:
- Added UseCamelCase flag to the tt file. You can now control if you want your table and column names CamelCase or left alone: i.e. FieldPersonOrder or field_person_order
Whats new in v1.9.2:
- Removed the Linq de-duplication code as it is now being done in SQL. The Linq version did not include the schema name when de-duplicating FK's.
Whats new in v1.9.1:
- Added DISTICT to the foreign key SQL. This prevents duplicates from appearing.
They can appear with SQL such as:ALTERTABLE [Mars].[Table2] WITHCHECKADDCONSTRAINT [FK_Table2_Table1]
FOREIGNKEY([Table1Id]) REFERENCES [Mars].[Table1] ([Id]) ALTERTABLE [Mars].[Table2] CHECKCONSTRAINT [FK_Table2_Table1]
Whats new in v1.9.0:
- It now has the ability to read connection strings from other config files/projects.
It starts by looking at the local project for the named connection string in the following files:- app.config
- web.config
- app.config.transform
- web.config.transform
- or edit the above list in the .tt and specify which file(s) to use
Whats new in v1.8.0:
- Can now optionally generate separate files. See the new boolean flag GenerateSeparateFiles.
- Removed the hard coded 300 second timeout. The timeout can be specified in the connection string.
Whats new in v1.7.1:
- Add support for DateTime2
- Add support for UnitOfWork and the repository pattern. This means you can now unit test your repositories. See the source code for examples.
- Add IDisposable to db context.
Whats new in v1.7.0:
- Add .HasPrecision(precision, scale) for fields that have scale. Thanks to @choudeshell
Whats new in v1.6.0:
- Enhance ReadSchema performance with early table exclusion.
- Now supports columns with symbols and punctuation.
- Handles decimal default values.
Whats new in v1.5.1:
- A bugfix for WCF. See issue https://efreversepoco.codeplex.com/workitem/4
Whats new in v1.5.0:
- Ability to add WCF(DataMember, DataContract attributes) support on Entity. Requested by spatemp
Whats new in v1.4.1:
- Foreign keys are only included if they point to a primary key.
Whats new in v1.4.0:
- If a field has a default contrainst of GetDate(), add DateTime.Now() in the ctor for the field.
- Add support for the datetimeoffset type, including support for the default constraint sysdatetimeoffset().
- Add Resharper naming comments.
- Mappings should be marked internal. Requested by Hobbes Pirakitti