Entity Framework Core Feature Suggestions

Welcome! Use this web site to submit ideas and vote for what features you want to see in future versions of Entity Framework Core.

Our team will only fix bugs, implement small improvements and accept community contributions in the EF6 codebase. Larger feature work and innovation will happen only in the EF Core codebase. If you have ideas for improving EF6, we recommend you submit them on the EF6 GitHub site listed below.

Please also consider these other options before submitting anything to this site:

  • If you want to learn how to use our products, visit our documentation pages.
  • If you want to report bugs, make contributions, or learn about our product roadmaps, visit our EF Core or EF6 project pages on GitHub.
  • If you have technical questions or need help, try StackOverflow’s EF Core or EF6 tags, or visit our MSDN forums. Note that roadmap questions, bug reports, feature requests or ideas are not appropriate for StackOverflow. Visit StackOverflow’s help center for guidance on appropriate usage.

How can we improve Entity Framework Core?

You've used all your votes and won't be able to post a new idea, but you can still search and comment on existing ideas.

There are two ways to get more votes:

  • When an admin closes an idea you've voted on, you'll get your votes back from that idea.
  • You can remove your votes from an open idea you support.
  • To see ideas you have already voted on, select the "My feedback" filter and select "My open ideas".
(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. 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.

    10 votes
    Vote
    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      You have left! (?) (thinking…)
      0 comments  ·  runtime  ·  Flag idea as inappropriate…  ·  Admin →
    • Define RelatedProperty on an inherited foreign key

      Allow mapping to entity in a derived class based on a property in base class.

      Normally, we create a [RelatedTo] property for a foreign key defined in the same class.

      But it would be quite handy to be able to define [RelatedTo] on a Foreign Key defined in the base class.

      10 votes
      Vote
      Sign in
      Check!
      (thinking…)
      Reset
      or sign in with
      • facebook
      • google
        Password icon
        I agree to the terms of service
        Signed in as (Sign out)
        You have left! (?) (thinking…)
        0 comments  ·  runtime  ·  Flag idea as inappropriate…  ·  Admin →
      • 9 votes
        Vote
        Sign in
        Check!
        (thinking…)
        Reset
        or sign in with
        • facebook
        • google
          Password icon
          I agree to the terms of service
          Signed in as (Sign out)
          You have left! (?) (thinking…)
          0 comments  ·  Flag idea as inappropriate…  ·  Admin →
        • Throw exception when you attempt to access a navigation property that is not loaded

          Of course this should be an optional feature that can be enabled from the DbContext configuration. It only makes sense when Lazy Loading is disabled.

          This will be particularly useful for writing domain models that are independent of the data access technology and thus cannot use the EF functions to check whether a property is loaded.

          Currently, if the logic inside the domain model tries to access a navigation property that is not loaded, this will either fetch the data from the database if lazy loading is enabled (a lot of developers do not like lazy loading) or, if lazy…

          9 votes
          Vote
          Sign in
          Check!
          (thinking…)
          Reset
          or sign in with
          • facebook
          • google
            Password icon
            I agree to the terms of service
            Signed in as (Sign out)
            You have left! (?) (thinking…)
            1 comment  ·  Flag idea as inappropriate…  ·  Admin →
          • Visual Studio diagram designer

            A full fledged diagram designer that allows editing the EF Core model using boxes and lines metaphor rather than code. Where you can add/update/remove tables and views from an existing database.

            9 votes
            Vote
            Sign in
            Check!
            (thinking…)
            Reset
            or sign in with
            • facebook
            • google
              Password icon
              I agree to the terms of service
              Signed in as (Sign out)
              You have left! (?) (thinking…)
              0 comments  ·  tools  ·  Flag idea as inappropriate…  ·  Admin →
            • Support tuples in query expressions

              With the introduction of first-class support for tuples in C#7, Entity Framework should add support for tuples inside query expressions along.
              SO issue here: http://stackoverflow.com/questions/17595105/use-tuples-with-entity-framework-contains-statement

              The lack of support for this is super frustrating, especially since anonymous classes are not supported in EF either, and from a performance perspective this is simply a fixed number of values being passed into a query (ie: should not be any more complex to execute on the DB).

              For example, the following should work but is currently not supported:

              IEnumerable<string> identifers = /*get from somewhere*/....;

              Tuple<string, string>[] identifierPairs = originIdentifers.Select( _ => {
              string[]…

              9 votes
              Vote
              Sign in
              Check!
              (thinking…)
              Reset
              or sign in with
              • facebook
              • google
                Password icon
                I agree to the terms of service
                Signed in as (Sign out)
                You have left! (?) (thinking…)
                0 comments  ·  Flag idea as inappropriate…  ·  Admin →
              • Entity Designer: custom metadata editor

                I would like to add my custom metadata using Entity Designer and then use it within T4 templates. To achive it with current version I must write my own extension for Visual Studio - it is not convenient.

                9 votes
                Vote
                Sign in
                Check!
                (thinking…)
                Reset
                or sign in with
                • facebook
                • google
                  Password icon
                  I agree to the terms of service
                  Signed in as (Sign out)
                  You have left! (?) (thinking…)
                  1 comment  ·  Flag idea as inappropriate…  ·  Admin →
                • Clear, Complete, and Accurate Documentation

                  Break the mold! Provide clear concise documentation that describes the API, the intended use for each API, the purpose and use (with examples of the arguments to each method), and explanatory samples and snippets that are both complete and clearly show the intened information.

                  9 votes
                  Vote
                  Sign in
                  Check!
                  (thinking…)
                  Reset
                  or sign in with
                  • facebook
                  • google
                    Password icon
                    I agree to the terms of service
                    Signed in as (Sign out)
                    You have left! (?) (thinking…)
                    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
                  • 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…

                    9 votes
                    Vote
                    Sign in
                    Check!
                    (thinking…)
                    Reset
                    or sign in with
                    • facebook
                    • google
                      Password icon
                      I agree to the terms of service
                      Signed in as (Sign out)
                      You have left! (?) (thinking…)
                      1 comment  ·  runtime  ·  Flag idea as inappropriate…  ·  Admin →
                    • Change schema for DbContext per connection

                      Build one model from code first and then use new TennantContext(connection, schema).

                      Exactly as HasDefaultSchema but possible to change with new connection.

                      No migrations and no other special features needed.

                      Lets say I have users data stored in one DB but in different schemas (each user has own schema). I have 1000+ of users, every model for every user is cached by IDbModelCacheKeyProvider is RAM kill.

                      P.S. Alter user set default schema is not a solution

                      Thanks

                      9 votes
                      Vote
                      Sign in
                      Check!
                      (thinking…)
                      Reset
                      or sign in with
                      • facebook
                      • google
                        Password icon
                        I agree to the terms of service
                        Signed in as (Sign out)
                        You have left! (?) (thinking…)
                        0 comments  ·  runtime  ·  Flag idea as inappropriate…  ·  Admin →
                      • 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

                        9 votes
                        Vote
                        Sign in
                        Check!
                        (thinking…)
                        Reset
                        or sign in with
                        • facebook
                        • google
                          Password icon
                          I agree to the terms of service
                          Signed in as (Sign out)
                          You have left! (?) (thinking…)
                          0 comments  ·  runtime  ·  Flag idea as inappropriate…  ·  Admin →
                        • Mapping n to n relation in a table with discriminator like TPH

                          The most interesting side effect of TPH is that the DB need less tables and the overview is much better. Another interesting way to reduce the number of tables in a DB is to map the n to n relations in one table with a discriminator like the TPH.
                          The xsd schema allow already to add a condition to the associated set mapping (n to n) but it's not supported from EF.
                          This forum topic describe the problem and how it could be solved.
                          http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/7144757d-c124-4932-b2bf-d0ab845597fd

                          9 votes
                          Vote
                          Sign in
                          Check!
                          (thinking…)
                          Reset
                          or sign in with
                          • facebook
                          • google
                            Password icon
                            I agree to the terms of service
                            Signed in as (Sign out)
                            You have left! (?) (thinking…)
                            0 comments  ·  tools  ·  Flag idea as inappropriate…  ·  Admin →
                          • 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.

                            9 votes
                            Vote
                            Sign in
                            Check!
                            (thinking…)
                            Reset
                            or sign in with
                            • facebook
                            • google
                              Password icon
                              I agree to the terms of service
                              Signed in as (Sign out)
                              You have left! (?) (thinking…)
                              0 comments  ·  Flag idea as inappropriate…  ·  Admin →
                            • 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

                              9 votes
                              Vote
                              Sign in
                              Check!
                              (thinking…)
                              Reset
                              or sign in with
                              • facebook
                              • google
                                Password icon
                                I agree to the terms of service
                                Signed in as (Sign out)
                                You have left! (?) (thinking…)
                                1 comment  ·  Flag idea as inappropriate…  ·  Admin →
                              • 9 votes
                                Vote
                                Sign in
                                Check!
                                (thinking…)
                                Reset
                                or sign in with
                                • facebook
                                • google
                                  Password icon
                                  I agree to the terms of service
                                  Signed in as (Sign out)
                                  You have left! (?) (thinking…)
                                  1 comment  ·  runtime  ·  Flag idea as inappropriate…  ·  Admin →
                                • Update model from database should update complex types returned by stored procedures

                                  When using option 'Update model from databes' VS should update complex types returned by SP - now every SP have to be updated manually

                                  9 votes
                                  Vote
                                  Sign in
                                  Check!
                                  (thinking…)
                                  Reset
                                  or sign in with
                                  • facebook
                                  • google
                                    Password icon
                                    I agree to the terms of service
                                    Signed in as (Sign out)
                                    You have left! (?) (thinking…)
                                    1 comment  ·  tools  ·  Flag idea as inappropriate…  ·  Admin →
                                  • Allow "normally"/correctly formatted connection strings

                                    Connection string sections now needs two connection strings: one for EF to use, and one for all other standard .Net Framework APIs utilising the same database.

                                    This is kinda bizarre, violating DRY, KISS etc.

                                    The requested change:
                                    Have a config section for EF.
                                    Have all non-standard connection string settings set here.
                                    Have it reference the regular connection string section to get the standard settings for the database.
                                    Combine the settings within the framework in order to make a connection.

                                    Simple, no?

                                    8 votes
                                    Vote
                                    Sign in
                                    Check!
                                    (thinking…)
                                    Reset
                                    or sign in with
                                    • facebook
                                    • google
                                      Password icon
                                      I agree to the terms of service
                                      Signed in as (Sign out)
                                      You have left! (?) (thinking…)
                                      3 comments  ·  Flag idea as inappropriate…  ·  Admin →
                                    • Support Pessimistic Concurrency

                                      Allow a Select with UpdLock which locks all returned entities in the Database. This is a basic requirement to program for example a ticket sales portal with entity framework! So far it's not possible and I still have to stick to NHibernate :(

                                      8 votes
                                      Vote
                                      Sign in
                                      Check!
                                      (thinking…)
                                      Reset
                                      or sign in with
                                      • facebook
                                      • google
                                        Password icon
                                        I agree to the terms of service
                                        Signed in as (Sign out)
                                        You have left! (?) (thinking…)
                                        0 comments  ·  runtime  ·  Flag idea as inappropriate…  ·  Admin →
                                      • 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.

                                        8 votes
                                        Vote
                                        Sign in
                                        Check!
                                        (thinking…)
                                        Reset
                                        or sign in with
                                        • facebook
                                        • google
                                          Password icon
                                          I agree to the terms of service
                                          Signed in as (Sign out)
                                          You have left! (?) (thinking…)
                                          1 comment  ·  runtime  ·  Flag idea as inappropriate…  ·  Admin →
                                        • Support for .Contains(Entity)

                                          Be able to write code like "if (Context.Table.Contains(entity))"

                                          8 votes
                                          Vote
                                          Sign in
                                          Check!
                                          (thinking…)
                                          Reset
                                          or sign in with
                                          • facebook
                                          • google
                                            Password icon
                                            I agree to the terms of service
                                            Signed in as (Sign out)
                                            You have left! (?) (thinking…)
                                            3 comments  ·  runtime  ·  Flag idea as inappropriate…  ·  Admin →
                                          1 2 5 7 9 15 16
                                          • Don't see your idea?

                                          Entity Framework Core Feature Suggestions

                                          Feedback and Knowledge Base