[Closed] Entity Framework Core Feature Suggestions

This web site 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 over at GitHub.com. We are not planning to migrate the list of ideas posted here automatically, 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, try Stack Overflow’s 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. Foreign Key Constraints on Views

    The "create/update modell from database" functions of the EF designer should support foreign key constraints on views.
    As a result of the foreign keys we get navigation properties on the views.

    (In Oracle database it is possible to create (disabled) foreign keys between views.)

    5 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Flag idea as inappropriate…  ·  Admin →
  2. Database VIEW creation support and specific mapping of entites to views.

    Currently, to get Code First to create a database with a VIEW, the CREATE VIEW sql statement must be hacked a couple of Context.Database.ExecuteSqlCommand's. One to drop the table that EF created for the entities you're mapping to it and another to create the view using the same name as the table EF assumes is still there.

    When mapping an entity to a view, you have to use modelBuilder.Entity<T>.ToTable and treat the view as a table. Entity Framework assumes the view is still a table and assumes it's read/write. A new method of .ToView might be added to tell EF…

    13 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Flag idea as inappropriate…  ·  Admin →
  3. Migrations: Allow Multiple Migration SQL Generator per Provider

    One way to allow community to contribute to EF Migrations is allow us to create more `MigrationOperation`s.

    For example, people can then add things like full text index, etc., things that are not in the core EF Migrations and are just boring SQL statements that need to be combined together.

    Currently, to build a provider agnostic `MigrationOperation`, you need to write the SQL generated for the operation in a class derived from `MigrationSqlGenerator`. If you want to add `CreateFullTextCatalog` operation and support SQL Server for example, you inherit `SqlServerMigrationSqlGenerator`, add a `Generate` method for your operation, and ensure all other…

    5 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  4. 5 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Flag idea as inappropriate…  ·  Admin →
  5. 5 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  6. Allow adding fluent code to each entity, to minimize the mess in the context

    There should be a way (perhaps by implementing an interface), to add fluent code separately to each entity instead of adding it all in the OnModelCreating method.
    The OnModelCreating base method should call all the entities that implement that interface and call OnModelCreating(context) of it.
    In this way the bunch of fluent code in the main context, especially if it's a large one, would tidy up in the individual entities.
    Of course, this is already simply doable, but I think this should go out the box.

    5 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Flag idea as inappropriate…  ·  Admin →
  7. Support for multiple result sets in .ExecuteFunction() and .ExecuteQuery()

    public Tuple‹T1, T2› ExecuteQuery‹T1, T2›(string query) { ... }
    public Tuple‹T1, T2, T3› ExecuteQuery‹T1, T2, T3›(string query) { ... }

    5 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Flag idea as inappropriate…  ·  Admin →
  8. Allow only some CUD operations to map to stored procedures

    At present, mapping stored procedures is an all or nothing proposition. Either you map each of the Insert, Update and Delete procedures or none at all. It would be great to utilize the generated functionality as is but still have the option to override just one of the three.

    5 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  9. support for ordering in Include()

    using the include() with a 1 to many relationship, the data are loaded in the list without any specific order, forcing often to reload directly specifying the sort order

    5 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  10. More precise log messages

    When I was experimenting with EF7 and mapped an identity column to a Int64 property, I got an exception. Unfortunately the exception did not told me:
    - which entity
    - which property
    had that mapping error...

    So really, instead of having 2 pages of stack trace, those 2 words would have been more useful... NHibernate does this, don't tell me that a new ORM (almost 1 and a half decade after the birth of NH) is not capable of doing at least the same as the old ORM...

    4 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  11. Migrations: Reset migrations function

    Currently, people are hacking a way around the issue of needing to Reset migrations: http://stackoverflow.com/questions/11679385/reset-entity-framework-migrations

    The current solution means deleting the migration folder and then deleting the migration history table in the DB, and then adding a brand new migration - but then having to comment out the code in the UP()... which works but isn't optimal for example to check db consistency or when having new developers onboard the team and just being able to run Update-Database on their machine.

    4 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  12. Allow interception of the creation of dynamic proxies

    At the moment, the creation of a dynamic proxy for a POCO class is an internal process. I'd like to be able to intercept this proxy creation event (possibly through the service locator) in order to be able to emit additional properties / methods into the dynamic proxy class or to customize the functionality of the existing change tracking / lazy loading code.

    4 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  13. DbContext.Database Interface

    Please please please....

    Can we have DbContext.Database Interfaced so that we can unit test our EF code first operations on DbContext.Database

    thanks!
    Dean

    4 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Flag idea as inappropriate…  ·  Admin →
  14. Support optional complex type

    For example: Class Foo has a property named Bar and that property is a reference to the complex type ComplexBar. It would be great if Bar could be left null in cases when a "user/whatever" does not have any ComplexBar information. The benefit is that ComplexBar can have required properties and other validation that only applies when the property Bar is not null. If it is null then that validation is not triggered because it does not apply. If I want Bar to always have a value then I can flag it as required, and it will behave like complex…

    4 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Flag idea as inappropriate…  ·  Admin →
  15. Navigation properties in composite ids without need for the corresponding scalar property

    If you have a class like

    public class CustomerAddress
    {
    public virtual Customer Customer { get; set; }
    public virtual Address Address { get; set; }
    public virtual string AddressType { get; set; }
    public virtual DateTime ModifiedDate { get; set; }
    }

    you should be able to create a composite id like this

    HasKey(a => new { a.Customer, a.Address });

    without defining CustomerId and AddressId properties

    4 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  16. System.Data.Entity.DbSet<TEntity>.Create() method overload for taking n parameters

    The idea would be to overload Create() method on DbSet so as to take any parameters, resolving to the constructor tha best fits, like so

    public TEntity Create(params object[] args);

    (I understand the generated proxy for change tracking and nivigational properties support should honor all constructors defined on the TEntity type)

    This would allow for a much cleaner (and layarable) DomainModel. Entities may now be created from required values and the need to set those values (i.e. the need for public setters) after the creation dissapears.

    4 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  17. 4 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Flag idea as inappropriate…  ·  Admin →
  18. Query serialization / deserialization

    ** SUGGESTION **
    Native support for query serialization and deserialization (to XML) decoupled from a concrete ObjectContext, including query parametrization and correct management of lambda expressions (e.g. using expression expansion as in LinqKit).

    ** WHY **
    We've developed a set of classes that allow a query to be written in the client layer and executed in the service layer via web services (with POCO entities). After the query is written normally using linq to entities and obtaining an IQueryable<T> object, this implementation transparently does the following:

    CLIENT side:
    - Expands the query expression tree to correctly manage lambda expressions.
    -…

    4 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  19. Create method should initializer collection navigation properties

    I've found that in Code First entities, my "many" properties such as

    property List<People> SomePropertyName {get; set;}

    are null when the entity is instantiated. This breaks the common "convention" of just simply adding entities to the list:

    You can't just
    MyEntity.SomeManyProperty.Add(SomeOtherEntityInstance);

    You have to do
    MyEntity.SomeManyProperty = new List<SomeOtherEntity> { SomeOtherEntityInstance };

    but, of course, you can't just do that, because you might wipe out an existing list, if there is one, so you must then do a check first. Ugly.

    As a lesser evil, I've resorted to instantiating empty lists in the constructor of my entities but this is…

    4 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    5 comments  ·  Flag idea as inappropriate…  ·  Admin →
  20. Support for generic complex types

    You should support for using generic complex types. Consider scenerio where I would like to create Rage<T> type. Now I must create RangeOfInt32, RangeOfInt64, RangeOfDecimal, etc. It will be also great if that class could be defined outside of the model.

    4 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Flag idea as inappropriate…  ·  Admin →

[Closed] Entity Framework Core Feature Suggestions

Feedback and Knowledge Base