Entity Framework Feature Suggestions
Welcome! You can use this site to tell the Entity Framework team what features you want to see in future versions.
Remember that this site is only for feature suggestions and ideas!
If you have technical questions or need help with EF try StackOverflow or visit our forums.
If you want to report a bug you found in EF use the Entity Framework project page on CodePlex.
If you want to find more information about the Entity Framework go to our MSDN site.
-
Code First support for Stored Procedures
EF 4.1 doesn't support stored procedures in code-first:
http://blogs.msdn.com/b/adonet/archive/2011/03/15/ef-4-1-release-candidate-available.aspx
262 votes -
Customize mapping for stored procedure
So far a stored procedure cannot be mapped to an entity with complex properties. Well it can be mapped, but the execution fails at runtime. It would be great if we could map stored procedure columns to entity properties.
260 votes -
Decouple entity creation in EF and support entities without default constructors and publically settable properties
EF should decouple the implementation of the entity objects from the mapping functionalities. The EF team could provide the current entity creation as a default variant which can be attached to the mapper. The developer has the option to provide it's own data transfer object layer. Therefore we need to abstract the entities through interface usage an a generic naming schema (dot notation of an object model like Person.Name). So the EF would be much more flexible to use.
Note by Diego Vega: I am merging this idea with a few other ideas that are approximately equivalent but extend in…
211 votes -
'include' property of derived classes
In entity framework there should be a way to eager load (include) navigation properties of a derived class.
When in an data model for entity framework has a navigation property it is not posseble to eager load that navigation property besides when using OfType<> or when eager loading the derived type itself by a navigation property.
This could be done by using a special syntax of the include path.
Since a property of the base class can not have the same name as the derived class, it would also be possible to navigate to the derived class by its name.…
207 votes -
Use OFFSET and FETCH for Take and Skip for SQL server 2012
When using SQL Server 2012 I would like Take and Skip being converted as in floowing example
SELECT *
FROM Customers
ORDER BY CustomerID
OFFSET 2 ROWS
FETCH NEXT 50 ROWS ONLY;205 votes -
194 votes
-
Delete orphan records
Entity Framework should support automatic deletion of orphan records, the way "all-delete-orphan" works in NHibernate.
If I have a one-to-many relationship between Orders and OrderLines, and code inside the Order class calls OrderLines.Remove(orderLine), this should cause the order line to be deleted when I save changes. Currently, EF attempts to set the order line's OrderID to NULL. If the OrderID column is non-nullable, the update fails with a constraint violation error.
I found this forum post in which Daniel Simmons from Microsoft says EF doesn't support this: http://social.msdn.microsoft.com/forums/en-us/adodotnetentityframework/thread/CB9C1C4A-DF12-44E4-B00A-417C80BF5453
This is an important feature for an ORM, since it's difficult to…
167 votes -
Bring back CompiledQuery in Code First
CTP 5 dropped compiled query support, this is a huge mistake. Please make sure it is there in the final product.
167 votes -
Support for stream instead of byte[] for varbinary fields
Support for mapping System.IO.Stream to Binary fields
155 votes -
EF5 Model First - Genrate DB Update Script
I am creating a Database with the Model First SQL Script Generation. Then later when I need to Update the Model I don't want to delete all tables and content, I want to generate an update Script.
Its possible in EF4 with an Tool:
http://visualstudiogallery.msdn.microsoft.com/df3541c3-d833-4b65-b942-989e7ec74c87/but in EF5 there is atm no possibility to update the Model with "Model first".
Idea: perhaps try to include the SQL-Schema Comparer in EF.
149 votes -
Extra Lazy-Loading
When I do user.Cars.Add() EF load all Cars for that user.
user.Cars.Count() too146 votes -
Automatically perform retry logic for SQL Azure
Ideally, a simple IsSqlAzure=true in the connection string would have EF automatically implement SQL Azure retry logic under the hood. The current Microsoft recommendation requires wrapping every single DB query with more code, and is a very inefficient solution. Reference:
http://blogs.msdn.com/b/appfabriccat/archive/2010/12/11/sql-azure-and-entity-framework-connection-fault-handling.aspx140 votesWe are planning to do something like this to improve EF’s connection resiliency in EF6.
-
Support for hierachical queries and HierarchyID
One of the things that most simple business applications require is heirarchy. Whether it be a tree for data selection or a threaded comment set, Heirarchy is horrible to implement in EF and LINQ - I'd like to see methods that support it better.
138 votes -
Code First support for Table-Valued Functions
The EF team has marked the previous TVF feature suggestion as Completed saying TVF support will be included with .NET 4.5. It had 226 votes at the time. However, this excludes Code First support. Vote for this suggestion to specifically add Code First support for TVFs.
133 votes -
Ability to specify NoLock and other query hints
Table lock, update lock ( WITH(UPDLOCK) / FOR UPDATE ).
LockMode something like NHibernate.Also should support controlling parameter sniffing
126 votes -
Make Entity Framework Fully Mockable and injectable In general, mocking out the Entity Framework DAL is a big pain to accomplish. ObjectCon
Make Entity Framework Fully Mockable and injectable
In general, mocking out the Entity Framework DAL is a big pain to accomplish. ObjectContext has no interface and the T4 templates aren't written to create interfaces for the objects they create.
This hampers good unit testing and makes them less injectable.
Put an interface on ObjectContext. Have the T4 Templates put interfaces around all of the objects that are generated and make sure that all objects used have interfaces so that mocking frameworks, like MOQ or Moles & Pex can automatically generate stubs to replace the objects in unit tests so that…
125 votes -
Take namespaces into account for POCOs mappings
This is a must for modularity. We already support this feature on our side with schemas (sql server) the only problem is EF does not take namespaces into account.
118 votes -
Class diagram for Code-First POCO classes
Need a new type of ClassDiagram tool for Code-First POCO classes which should be similar to Entity Designer, capable of showing relationships, keys, db schema related meta data etc.
118 votes -
Full Stored Procedure support: Return Values etc ...
Support Stored Procedure Return Values, output parameters of any type and procedures that don't return a result set, like an update statement.
99 votes -
Simple Static Delete and Update Methods
Allow for simple delete and update operations that do not require multiple round trips to the database. They could be static methods on each Entity. For example:
Cars.Delete(int ID)
or
Cars.Delete(Guid ID)This would delete a car record with the associated ID if it exists. The code generation template should be smart enough to create the static methods using the correct data type.
For updates you would pass in the ID and a set of named parameters for the fields that need to be updated:
Car.Update(10, {Status="Sold", ModifiedDate=DateTime.Now}
I think people are doing this now using functions or executing SQL
95 votes
- Don't see your idea?