[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. Provide EF Code-First migrations support for one DbContext but multiple shard databases

    I have a DbContext that is initialized with a connection string in its constructor. Each connection string points to a database that has the same exact schema as any other and is treated as a unique shard of a SQL farm.

    I want to be able to add migrations once and update all databases with ease. This is particularly useful for web applications that need to scale out their DB layer.

    1 vote
    Sign in
    (thinking…)
    Sign in with: facebook google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  2. Make DbDataReader available to ObjectMaterialized event handlers

    In many cases, we use joins or custom queries to return additional related data for an entity. Its a bit of paint today to manipulate this custom data and load it into the entity selectively.

    I have found a workaround using the Translate method on ObjectContext. Basically in such cases, we will execute the query manually and have the entities materialized using ObjectContext.Translate. Before invoking this method, we save the Reader in an instance variable for DbContext that is later available in ObjectMaterialized event.

    This is working great, just that we need to ensure to use Translate when we need…

    1 vote
    Sign in
    (thinking…)
    Sign in with: facebook google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  3. 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…)
    Sign in with: facebook google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Flag idea as inappropriate…  ·  Admin →
  4. Support ObjectContext.Translate on joined result sets

    We sometimes end up doing 20 or more result sets in a single stored proc. Many times, a large majority of these are to bring back a single entry for each navigation property mapping.

    I would like to see a "wide" translate function.
    If a query has:
    SELECT a.*, b.*, c.*, d.*

    I'd like to see a version of Translate that can map each row to 4 separate object types, using the assumption that all of object A's columns are first, followed by B's, etc.

    This would greatly reduce the size of our stored procs, though there could be a…

    1 vote
    Sign in
    (thinking…)
    Sign in with: facebook google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  5. Generate DbSet.FindByKey method taking typesafe primary key

    The Find method on DbSet just take a "params object[] keyValues" parameter - not very typesafe.

    I would suggest amending the standard templates to generate

    public static class ExtendDbSet
    {
    public static MyEntity FindByKey(this DbSet<MyEntity> dbSet, Guid id)
    {
    return dbSet.Find(id);
    }
    }

    where the id parameters are generated.

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

    We’ll send you updates on this idea

    1 comment  ·  Flag idea as inappropriate…  ·  Admin →
  6. [DefaultValue(...)] is not handled by Code First migration

    In a column I can add [DefaultValue] attribute, but at the end it is ignored by the migration step. Confused. Please add support for this.

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

    We’ll send you updates on this idea

    1 comment  ·  Flag idea as inappropriate…  ·  Admin →
  7. Allow foreign key columns to be shared between a subset of TPH subclasses

    Scenario in the post http://entityframework.codeplex.com/workitem/583 works only for columns that are not foreign keys.

    For example we have BaseEntity and three inherited entities:
    InheritedEntity1.Name
    InheritedEntity2.SpecialStatus
    InheritedEntity3.SpecialStatus

    SpecialStatus is entity stored in separate table.

    BaseEntity table will have columns 'Name', 'SpecialStatus_Id', 'SpecialStatus_Id1'

    Try to change the name of the column:
    modelBuilder.Entity<InheritedEntity2>().HasOptional(p => p.SpecialStatus).WithOptionalDependent().Map(i => i.MapKey("SpecialStatus_Id"))
    modelBuilder.Entity<InheritedEntity3>().HasOptional(p => p.SpecialStatus).WithOptionalDependent().Map(i => i.MapKey("SpecialStatus_Id"))

    and get an ModelValidationException:
    "One or more validation errors were detected during model generation:
    SpecialStatus_Id: Name: Each property name in a type must be unique. Property name 'SpecialStatus_Id' is already defined.
    "

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

    We’ll send you updates on this idea

    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  8. Improve Database First Support

    Code First is no match for real life situations and also Proxies create lot of runtime problems.

    We use Dictionary<Type,object> to store Lambda Expressions that are designed to act as Filters for one type. Here is the problem, at runtime code first entity type is a dynamic type leading to following problems.

    1. Dynamic Type implementation is hidden.
    2. It does not support INotifyPropertyChanged
    3. It does not allow us to inspect/validate property with partial methods which we were able to do with Database First (EDMX) Model.
    4. CreateSourceQuery is hidden, sometimes we want to only execute Any or inspect…

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

    We’ll send you updates on this idea

    1 comment  ·  Flag idea as inappropriate…  ·  Admin →
  9. 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…)
    Sign in with: facebook google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Flag idea as inappropriate…  ·  Admin →
  10. Replication at the EntityFramework SaveChanges level

    Implement Replication to other databases in SaveChanges.
    I've tried to do it, but I can't save autogenerated IDENTITY values in replicated db's.

    1 vote
    Sign in
    (thinking…)
    Sign in with: facebook google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  11. Add FILEGROUP Support

    It should be possible to create tables, indices, etc. on different file groups in order to improve performance.

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

    We’ll send you updates on this idea

    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  12. Events for Insert and Update

    Some sort of hook to allow for custom managed code to be run when inserts and updates happen. Usage Scenarios:
    1) allow for SignalR updates of data realtime.
    2) complex validation rules.
    3) awesome cache invalidation
    4) additional logging techniques

    1 vote
    Sign in
    (thinking…)
    Sign in with: facebook google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Flag idea as inappropriate…  ·  Admin →
  13. namespace complex types

    Place complex types generated by the database in their own namespaces. Right now, when a stored procedure is imported, a complex type is generated and placed in no particular namespace, so all of the complex types are floating about.

    Perhaps instead, use the namespace that's been given to the model.

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

    We’ll send you updates on this idea

    1 comment  ·  Flag idea as inappropriate…  ·  Admin →
  14. Better support for modeling and regenerating existing database views

    The current database first support for views is not very good. I would like to see: readonly views where no key is assumed, updatable views where key can be selected, and at least an remembering of the actual create view syntax so that "generate database from view" will create a view and not a table. I often import a database view into my model and often do "generate database from model" to create a new empty database I can compare to production to make sure they are in sync. To do the latter, I have to delete all the sql…

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

    We’ll send you updates on this idea

    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  15. Use ICustomTypeProvider to aid in a runtime customisable multi-tenant solution

    It is easy enough to add properties to a ICustomTypeProvider class but getting EF to recognise the added field would make producing a customisable multi-tenant solution a lot easier.

    1 vote
    Sign in
    (thinking…)
    Sign in with: facebook google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  16. Support for MERGE (UPSERT) statement

    I would like to see the T-SQL MERGE statement supported. For multi threading situations it really would be useful.

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

    We’ll send you updates on this idea

    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  17. Better integration with Mainframe datasets

    Better integration with Mainframe datasets: instead of screen scraping or CTG or even Host Integration Server, using a EF Provider to unlock the data in a main frame would be a huge benefit to .NET developers

    1 vote
    Sign in
    (thinking…)
    Sign in with: facebook google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  18. Allow dependent Foreign Key properties to have a StoreGeneratedPattern of Computed

    Allowing dep. FK properties of the model to be generated by the database is useful for activity auditing (e.g. user logged into the DB gets their employee ID attached to the record by a trigger in insert/update).

    I understand the issues of having the DB generate the value (the value could violate the FK), but I put that on the same level as a DBA or other admin changing values that violate the FK (since the DBA or admin is likely doing the coding of the trigger itself).

    1 vote
    Sign in
    (thinking…)
    Sign in with: facebook google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  19. Updateable Views

    I would like to see update-able views. This is available in Telerik ORM, and I have found it very helpful in situations where I initially assumed a grid would only need to display read only data, but was months later asked to allow editing.

    There are other ways to do this of course, but they require recoding. This would make certain maintenance tasks easy.

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

    We’ll send you updates on this idea

    1 comment  ·  Flag idea as inappropriate…  ·  Admin →
  20. Persist/Query Calculated Properties (read-only)

    This is a very useful feature that is supported in NHibernate. Given this property in the Order Entity:

    public decimal OrderTotal
    {
    get { return Items.Sum(o => o.Total); }
    }

    EF should persist this "read-only" property which can also be used in LINQ queries.

    var results = from order in DbSet<Order>
    where order.OrderTotal > 100
    select order;

    I believe a current work around is to include an empty protected setter but that has code smell all over it.

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

    We’ll send you updates on this idea

    2 comments  ·  Flag idea as inappropriate…  ·  Admin →

[Closed] Entity Framework Core Feature Suggestions

Feedback and Knowledge Base