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.
-
Improved SQL Generation
I have seen simple select statements with 4 or 5 includes result in nearly 5000 line SQL statements when an equivalent hand-written SQL statement is ~15 lines. The performance of these queries along with the readability when debugging makes it an area that I would like to see the EF team focus on improving.
2,068 votesThe update for the core EF libraries that will be included in .NET 4.5 will include some improvements in SQL generation. However not all the scenarios mentioned in the comments will be addressed.
I am going to leave this idea as open for now, until we figure out a better way to track individual scenarios, which we need to do to get more actionable data.
-
Batch CUD support
When SaveChanges is called, rather than sending one SQL statement per insert/update/delete, batch it all up into one SQL statement
2,018 votes -
Unique Constraint (i.e.Candidate Key) Support
SQL Server and other databases support Unique Constraints on tables. Foreign key constraints are generally based on unique constrains on the principal side, with the Primary Key being only a special case of a unique constraint.
The Entity Framework currently only supports basing referential constraints on primary keys and does not have a notion of a unique constraint. The idea is to have:• Support for specifying a unique constraint on an Entity
• Support for specifying a foreign key associations that on the principal end specify columns(s) that comprise a unique constraint but are not the primary key,1,440 votes -
Support for Second Level Cache
Entity Framework currently support only first level cache (cache for entities). I would like to see a second level cahce implemented in the next version (queries cache).
1,216 votes -
Support for multiple databases
Like to be able to build a domain model over data in multiple databases. With out having to manage database objects - linked servers, views etc.
1,153 votes -
IndexAttribute
Create a IndexAttribute for annotating entities with index hints for the Database.
For Example[Index(Direction.Ascending)]
string MyProptery{Get;set;}944 votes -
Allow filtering for Include extension method
There is no ablity to filter included objects in ObjectQuery<TSource>.Include method.
Allow filter predicate in Include method in Entity Framework.
I suppose this method of ObjectQuery<TSource> may have following signature:/// <summary>
/// Includes related objects which meet to predicate
/// </summary>
/// <typeparam name="TRelation">Type of related object on another end of navigation property</typeparam>
/// <param name="relationSelector">Expression that returns set of related objects</param>
/// <param name="predicate">Predicate that has to be met</param>
/// <returns>Query</returns>
public System.Data.Objects.ObjectQuery<TSource> Include<TRelation>(Expression<Func<TSource, IEnumerable<TRelation>>> relationSelector, Expression<Func<TRelation, bool>> predicate);772 votes -
Table-Valued Parameters
TVP support for stored procedures
744 votes -
Support for simple type mapping or mapped type conversions
Currently the only conversion available in EF Core libraries 4.5 and EF 5.0 are enums mapped to integers but that is only tip of the iceberg. There is whole big feature behind - simple type mapping or conversions defined directly in mapping.
For example what if my database contains char column with Y, N values and I want to map it to bool property directly without any additional stuff doing the conversion inside my entity? Or more complex example - what if my column contains value like en-us and I want to map it to instance of CultureInfo? There are…
722 votes -
Support GUID as Entity Key
This should be supported in the designer.
http://leedumond.com/blog/using-a-guid-as-an-entitykey-in-entity-framework-4/718 votes -
Entity Designer: Speed up & Optimize for using with ~200+ entities
Entity designer is practically useless with non trivial models (for enterprise applications). Generate model from DB with more than 200 tables with FKs (I have tried on 350+ 9Mb edmx), and try to move entities and so on. It is nightmare.
Possible improvements:
1) Profile and optimize :)
2) To have option: To show or Not relationships.
3) To have option: Display or not fields in table.
4) To have subject areas: Render only subset of tables.
5) Separate model to several edmxs and have ability setup relations between entities from different edmxs.
6) To explore tools like ErWin, Power…698 votes -
TPT (Table-Per-Type) Inheritance Performance
Problem Description:
For TPT inheritance, the more subclasses you add, the time it takes to generate SQL, and the complexity of the SQL query itself, become unmanageable. With a simple base class (5 or 6 fields), and around 30 simple subclasses (2 or 3 fields a piece), it takes almost 2 minutes to generate the SQL (ObjectQuery.ToTraceString()) and execute it on the server. EF generates almost 8000 lines of SQL for a simple select query on the base class. This is because the SQL generated is a mess of crazy subselects, joins, and unions. Even with empty tables (so that…523 votesEF 5.0 contains significant improvements for TPT, but there are futher improvements we would like to make in the long run.
-
XML data type support
EF4 full support of XML field
403 votes -
Incorrect handling of null variables in 'where' clause
Problem Description:
The following LINQ-to-Entites query will return the expected results:
var result = from o in table
where o.column == null
select entry;However, the following query will never return any results:
int? myNullInt = null;
var result = from o in table
where o.column == myNullInt
select entry;This is because the first query is correctly generating a 'column IS INT' query, while the second one generates a 'column = @p_linq_p; @p_linq_p = NULL'.
This problem affects both LINQ-to-Entities and LINQ-to-SQL. However, while LINQ-to-SQL has the not-so-bad workaround
where o.column.Equals(myNullInt)
The workaround for LINQ-to-Entities is much harder to…394 votesUPDATE: changing the status from completed to started. Turns out that SQL Server Compact provider for EF is incompatible with this feature, therefore we are not making this option the default in DbContext API. The option is still available going through the ObjectContext API.
The option to compensate for three-valued logic used in null equality comparisons performed by SQL databases will be included in the update of the EF core libraries that will ship as part of .NET 4.5. When enabled, this option will cause a LINQ expression such as ‘a == b’ to be translated to an equivalent SQL expression that will evaluate to true when both ‘a’ and ‘b’ are simultaneously null.
Since the option will cause a change in query behavior that could potentially break existing applications and could also have performance impact in specific scenarios, it will be disabled by default for…
-
Allow default date = NOW and provider.MinDate in CSDL
get asked about non-nullable date defaults frequently.
The only way to set a default date in the entity data model is to put a hard date in there, a string. If you have a known default date (e.g. 1900-01-01) this is fine. But often we want NOW to be the default and there's now way to indicate that in the model. Additionally, if there was a way to indicate EF should use the providers minimum value that would be nice. Even if it meant typing "SqlServer.MinDate' into the default attribute in the property window.
Even if the database knows how…
375 votes -
Offer an in-memory provider to use as test double / fake database
Instead of having EF connect to SqlServer or Oracle or whatever ... have the ability to provide an InMemory provider ... so our unit tests or general development can be quick. There's no .dbf or whatever. No triggers or stored procs or views. Just list or hashset backing collections (behind the scenes). Simple, yet fast.
Example scenario's.
The common : Blog posts and Users. When a person creates a new blog post (which is represented as an entity on the edmx) and adds a User to that blog post, (ie. the user who is making the post), the inmemory context…
324 votes -
Better support for Self-Tracking Entities
The current implementation of self-tracking entities is error-prone especially when combined with disconnected scenarios, such as, when using WCF services. The reconciliation process with the ObjectStateManager is convoluted and makes it easy to trip up when saving larger aggregates with Self-Tracking Entities. I would like to see more effort put in to improve the Self-Tracking Entities template and to improve how EF and Self-Tracking Entities interact.
323 votes -
Lazy Loading at Property/Column Level
At time we may require to lazy load at column level. For e.g. if we have a LOB column which could be huge, we may not want to load that upfront when the table is lazy loaded. Agreed that we can workaroudn this problem, but a straight forward way would be good to have
312 votes -
Better change tracking for POCO proxies
I've noticed that in the proxied poco classes, an entity is marked as modified whenever a property is set, regardless of whether the value has actually changed. I think it would be nicer if only truly modified entities are flagged as modified.
274 votes -
Support for other native data types and user defined types
Well it has to be in the .NET Framework data types, not sure whether there would be any work to do in EF for this. Meanwhile there should be a provision to include the new data types in the backend. for e.g. Oracle can have it's own user defined types, SQLServer 2008 R2 has HierarchyID datat type which I am not sure to what datatype it would map to at the conceptual level
We should have provision for such types
272 votes
- Don't see your idea?