[Closed] Entity Framework Core Feature Suggestions

This web site is planned to be retired on July 31, 2019, and it is no longer being monitored by the EF team at Microsoft.

We have decided to unify our feedback process to focus on our existing issue trackers at GitHub.com. We are not planning to migrate the list of ideas posted here, because some of these ideas and votes were submitted a long time ago and therefore the number of votes likely does not accurately reflect the current priority for customers.

You are welcome to re-submit your favorite ideas to our issue trackers. We only request that you first search for existing issues and try to avoid creating duplicates.

Please visit the EF Core issue tracker or the EF6 issue tracker depending on what product you want to report bugs, make contributions, or submit ideas for.

Note that our team will only fix bugs, implement small improvements and accept community contributions on the EF6 codebase. Larger feature work and innovation will happen only on EF Core.

If you want to learn how to use our products, visit our documentation pages.

If you have technical questions or need help, consider asking in Stack Overflow using the EF Core or EF6 tags.

Note that roadmap questions, bug reports, feature requests or ideas are not appropriate for Stack Overflow. Visit Stack Overflow’s help center for guidance on appropriate usage.

Search for existing suggestions

(thinking…)

Enter your idea and we'll search to see if someone has already suggested it.

If a similar idea already exists, you can support and comment on it.

If it doesn't exist, you can post your idea so others can support it.

Enter your idea and we'll search to see if someone has already suggested it.

  1. 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,507 votes
    Sign in
    (thinking…)
    Sign in with: facebook google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    60 comments  ·  Flag idea as inappropriate…  ·  Admin →
  2. 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

    1,438 votes
    Sign in
    (thinking…)
    Sign in with: facebook google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    25 comments  ·  Flag idea as inappropriate…  ·  Admin →
  3. Custom type mapping and type conversion support

    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…

    1,364 votes
    Sign in
    (thinking…)
    Sign in with: facebook google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    78 comments  ·  Flag idea as inappropriate…  ·  Admin →
  4. 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.

    1,209 votes
    Sign in
    (thinking…)
    Sign in with: facebook google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    26 comments  ·  Flag idea as inappropriate…  ·  Admin →

    Closing as this issue has become so general it is not actionable.

    Some improvements have been made over time to SQL generation in EF6 and earlier versions. However not all the scenarios mentioned in the comments have been addressed.

    Much effort has also been invested in having EF Core generate much simpler SQL queries than EF6 for the most common scenarios.

    Consider creating product bugs with specific queries that can be improved in the EF Core bug database at https://github.com/aspnet/EntityFramework/issues/

  5. Support for Enums

    I would really like support for enums in the model. This should of course be available in the designer as well.

    918 votes
    Sign in
    (thinking…)
    Sign in with: facebook google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    23 comments  ·  Flag idea as inappropriate…  ·  Admin →
    completed  ·  Diego Vega responded

    Support for mapping integer columns to enum types will be enabled by the update of the EF core libraries included in .NET 4.5.

    However, in this release we won’t be addressing some of the other ideas mentioned in the comments, such as type conversions in property mapping and design-time support for reverse engineering lookup tables into enum types. Since we are closing this item now, we encourage you to add/vote for those suggestions in separate items.

  6. 574 votes
    Sign in
    (thinking…)
    Sign in with: facebook google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    29 comments  ·  Flag idea as inappropriate…  ·  Admin →
    completed  ·  Diego Vega responded

    Code First has become a fundamental feature of Entity Framework since we released version 4.1.

    There are of course many improvements we can make (some of them mentioned in the comments, like database migrations and stored procedure support), but moving forward we encourage you to add or vote as appropriate those improvements in separate items so that we can track the votes more accurately.

  7. 466 votes
    Sign in
    (thinking…)
    Sign in with: facebook google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    17 comments  ·  Flag idea as inappropriate…  ·  Admin →

    After marking this as “declined” this weekend, I investigated a bit more and turns out the original issue posted here was fixed a long time ago:

    The issue as originally described in a blog post that is no longer available, but a copy can be found at https://web.archive.org/web/20120201232953/http://leedumond.com/blog/using-a-guid-as-an-entitykey-in-entity-framework-4/.

    In summary, changing the StoreGeneratedPattern of a GUID key property on the EF designer to Identity used not to change the corresponding store model column to Identity, then the EF runtime would not know to retrieve a generated value from the database after insert operations.

    This was hotfixed in the designer in 2011: https://support.microsoft.com/en-us/help/2561001/fix-unexpected-data-entry-or-data-corruption-might-occur-when-a-visual-studio-2010-sp1-ado.net-application-changes-data-in-the-storegeneratedpattern-attribute

    Now the EF designer keeps the column’s StoreGeneratedPattern in sync with property’s.

    That said, there are remaining limitations:

    1. Database first workflow (reverse engineering) does not recognize a default value of newid() or newsequentialid() on a GUID column as a hint that it should use StoreGeneratedPattern.Identity.

    2.…

  8. Designer speed up & optimization for models with more than 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 edmx’s and have ability setup relations between entities from different edmx’s.
    6) To explore tools like ErWin, Power…

    365 votes
    Sign in
    (thinking…)
    Sign in with: facebook google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    18 comments  ·  Flag idea as inappropriate…  ·  Admin →

    We have done a lot of work to improve responsiveness of the designer with larger models in the EF 6.x releases:

    - Stop performing view generation as often to validate the model
    - Stop performing code generation to obtain model errors
    - Stop re-parsing XML and saving to disk as often

    We also identified and fixed a few memory leaks that would cause responsiveness of VS to diminish over time in long sessions.

  9. Eager loading for properties 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.

    324 votes
    Sign in
    (thinking…)
    Sign in with: facebook google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    23 comments  ·  Flag idea as inappropriate…  ·  Admin →
  10. 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…

    321 votes
    Sign in
    (thinking…)
    Sign in with: facebook google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    7 comments  ·  Flag idea as inappropriate…  ·  Admin →
  11. Multiple designer pages for a single EDMX

    For a large database the number of entities displayed within the designer can be overwhelming. It becomes slow to load, it is difficult to find the entity within the diagram and it is nearly impossible to change the layout.

    SQL Server had been able to support multiple diagrams for the same database for many years. I would love to see a similar feature with the EF designer.

    309 votes
    Sign in
    (thinking…)
    Sign in with: facebook google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    13 comments  ·  Flag idea as inappropriate…  ·  Admin →
    completed  ·  Diego Vega responded

    Support for multiple diagrams in the Entity Designer will be included in Visual Studio 11. The feature will provide the ability to present the same entity type in multiple diagrams at the same time.

    We encourage you to add or vote for other suggestions mentioned in the comments in separate items.

  12. 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…

    289 votes
    Sign in
    (thinking…)
    Sign in with: facebook google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    13 comments  ·  Flag idea as inappropriate…  ·  Admin →
  13. Delete orphans support

    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…

    277 votes
    Sign in
    (thinking…)
    Sign in with: facebook google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    15 comments  ·  Flag idea as inappropriate…  ·  Admin →
  14. 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…

    251 votes
    Sign in
    (thinking…)
    Sign in with: facebook google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    3 comments  ·  Flag idea as inappropriate…  ·  Admin →
  15. Async/Await supported asynchronous calls

    With the looming release of Dot.Net 4.5 and Windows 8 we are really going to been aync calls which return a Task so there is support for the async/await keywords in C# 5.0

    Database operations can be notoriously slow making it highly necessary to delegate these tasks to an asynchronous model.

    Windows 8 dictates that if any operation in a metro style app takes longer than 50ms it should be async.

    await context.SaveChangesAsync()

    235 votes
    Sign in
    (thinking…)
    Sign in with: facebook google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    15 comments  ·  Flag idea as inappropriate…  ·  Admin →
  16. Entity Framework assemblies out of .NET Framework

    A ORM framework needs a much more frequent releases that .net framework

    206 votes
    Sign in
    (thinking…)
    Sign in with: facebook google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    8 comments  ·  Flag idea as inappropriate…  ·  Admin →
  17. Schema Migration a la Rails Migrations

    Database change management is a huge headache without the right tools, and the Microsoft stack doesn't have a good answer for this right now.

    Database projects were a valiant attempt, but diff-ing a live database with a set of text files is a clunky approach.

    Migrations have been used successfully on other platforms (notably, Ruby on Rails) to achieve iterative database change management. Several open-source projects on the .NET platform have even been started, but none have really gained traction.

    A migration solution from Microsoft with good tool integration would go along way to making database change management on the…

    201 votes
    Sign in
    (thinking…)
    Sign in with: facebook google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    9 comments  ·  Flag idea as inappropriate…  ·  Admin →
  18. 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…

    187 votes
    Sign in
    (thinking…)
    Sign in with: facebook google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    27 comments  ·  Flag idea as inappropriate…  ·  Admin →

    UPDATE: The SQL CE issue has been fixed in the EF6 provider and we changed the default behavior of EF6 to compensate for three-valued logic.

    UPDATE: 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…

  19. Support for spatial types and spatial query

    Support for spatial types and spatial query

    182 votes
    Sign in
    (thinking…)
    Sign in with: facebook google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    12 comments  ·  Flag idea as inappropriate…  ·  Admin →
  20. 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

    162 votes
    Sign in
    (thinking…)
    Sign in with: facebook google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    12 comments  ·  Flag idea as inappropriate…  ·  Admin →
← Previous 1 3 4 5 6 7

[Closed] Entity Framework Core Feature Suggestions

Feedback and Knowledge Base