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.

Entity Framework Feature Suggestions

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 vote and comment on it.

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

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

  1. Provide access to ModelBuilder for Database First

    Our database structure is set up in such a way that all tables contain soft-deleted columns and most contain an owner account key column.

    Both of these provide a level of filtering we would like to let Entity Framework take care of for us at a global level, instead of always writing "&& t.Deleted == false && t.Owner == LoggedInOwnerKey" on our linq join/where clauses.

    This is currently possible with Code First, when you use the DbModelBuilder during the DbContext.OnModelCreating() but that method is not available when using EDMX strategy.

    All we are doing with the DbModelBuilder is adding System.Data.Entity.ModelConfiguration.Conventions.IConventions…

    16 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 →
    • For char/nchar and varchar/nvarchar columns use the actual column type and size in the parameter definition

      I can see that EF uses varchar(8000) for the parameter instead of the actual type (char(6) in a particular case). Would it be possible for EF to use the actual column type and size instead of varchar(8000) or nvarchar(4000)?

      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  ·  Flag idea as inappropriate…  ·  Admin →
      • Support for OPTION (RECOMPILE) on generated queries

        There are many scenarios where parameter sniffing in SQL server creates serious performance problems. This is very problematic with many EF generated queries, since there is no control that allows you to tell the database optimizer not to use the parameter values or cache a plan. A simple mechanism to hint OPTION (RECOMPILE) on the generated queries would solve most of these issues.

        A more sophisticated solution that would allow the generated sql to leverage (Optimize for Unknown) would also be useful.

        Parameter sniffing and the related performance problems are a very prevalent issue with SQL server and if you…

        3 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 →
        • Hook to modify LINQ tree

          This is similar to the idea of modifying a generated SQL. Except that it applies to an earlier stage. I can imagine a scenario where a third party may come up with a really good LINQ optimizer.

          1 vote
          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 foreign key relationships to be configured from within code first Conventions

            I'm currently in the situation where I need to create a foreign key relationship for about 40 entities in my edmx back to a common "Users" table. I'd like to be able to solve this problem using Conventions, but it appears I cannot access the HasRequired or HasOptional functions from within a convention. I believe making these functions available would be a real time saver.

            3 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

              3 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 →
              • code first support for view

                allow to define a view by code first.

                actually we can map an entity to a view but it then becomes nasty to:
                - generate the database,
                - migrate the database
                - evolve the schema in general

                It should be possible to:
                - declare a DbSet that does not involve a table creation
                - declare a view, with a linq query for example, that allows view creation.

                For DbSet if should be a convention: if table name starts with vvv then it is a view, do not create a table

                For view creation... no idea actually.

                5 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 →
                • Table splitting without primary key

                  Should I have entities that use table splitting for storage, but do use a foreign key that is not the primary key, I want to be able to bring and store the data of them with the same structure I use for table splitting in fluent API as I do now with primary keys.

                  3 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 →
                  • sequence

                    support sequence, not only for key, but as a common field/column/property. This should be mapped, in sql server case, to CREATE SEQUENCE.

                    1 vote
                    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 →
                    • Ability to hook into ValidationContext creation and set ServiceContainer

                      I'd like to set the IServiceProvider in the ValidationContext constructor, so that I can access validation logic outside the IValidatableObject.Validate() method (and within custom data annotations) in a loosely coupled manner.

                      As far as I can see, ValidationProvider.GetEntityValidationContext() passes a null for the IServiceProvider and there is no way to override/"hook into" this method or InternalEntityEntry.GetValidationResult() from the public API.

                      Something like what ASP.NET MVC or Web API does with DataAnnotationsModelValidatorProvider or ValidatableObjectAdapter might be nice.

                      1 vote
                      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 Disabling the Default Transaction Behavior of ObjectContext.ExecuteFunction()

                        EF6 introduced a breaking change to the ObjectContext.ExecuteFunction() API causing it to start a transaction when one does not already exist. This behavior should be made optional.

                        26 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 →
                        • Isolate the migrations from EF

                          The migrations in EF is great. I'd love to see it isolated, so it can be installed seperatly.

                          Not every project needs the full EF (in DDD layer, Migrations isn't required, but my .Data or DAL layer needs it) and this would make it easier to use tools like Dapper (that doesn't have a Migrations included)

                          3 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 lazy loading proxies on internal POCO classes

                            I'd really like to not have all my model classes declared as public. Please support classes declared as internal. Even if there is a requirement to add InternalsVisibleTo("EntityFramework") or similar to the AssemblyInfo that is fine.

                            3 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 →
                            • Built-in concurrency update and delete

                              Built-in update and delete concurrencies by enable a standard rowrevision, combine with automatic scaffolding in mvc.

                              5 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 →
                              • Persistent caching of auto-compiled queries

                                I know that EF code first automatically compiles queries and caches the results. But "Cold" queries are so slow.. Is possible to persist auto-compiled queries somewhere in the database so EF won't need to re-compile them again if that cache is lost (app restarted).

                                3 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 →
                                • Optional Convention that assigns Default Value to not nullable types

                                  When using code first with an existing database, the "can not assign null to a non nullable type" exception can be realy painfull, because the compiler gives no warning, when i project a int? to a int.

                                  It would be very usefull to have a Convention / Configuration that enables the automatic use of GetValueOrDefault for these cases.

                                  6 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 →
                                  • Update database without seeding

                                    It would be great to be able to do an "update-database" without having to execute the seeding commands as well. We are seeding quite a lot of meta data into our system, and it is a waste of time to wait for seeding each time we update/manipulate our model.

                                    A flag in command prompt like

                                    update-database -noseeding

                                    would suffice.

                                    7 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 →
                                    • Designer Option to Support Conversion Mapping from DateTime to DateTimeOffset

                                      Request Designer Option to Support Conversion Mapping from DateTime to DateTimeOffset in light of community opinion seeminly moving toward DateTimeOffset as a standard. In fact, OASIS OData v4 pruned DateTime in favor of DateTimeOffset.

                                      Unfortunately, modifying database schema is much easier said than done. Entity should have some sort of automapping/conversion to support the get/set between the persistence and poco layers.

                                      1 vote
                                      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 →
                                      • Update with Where Clause

                                        We should be able to update with a where clause.

                                        For example, you have an entity named "Product" that is bound to a "User". You want to be sure that the update is done on the product that you have your new values but also to the current user when the product is saved. Normally, in SQL we do a Update statement on Product table by setting new values to the product (where clause). What is missing is the ability to also add a AND statement to add the User Id. This way, we can be sure that the entity…

                                        5 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 →
                                        • Allow indexers in LINQ queries

                                          Let us access indexers in the LINQ queries... Why do I need to save named POSTed data to an intermediate variable before I use it once to query the database? It worked fine in LINQ 2 SQL, and I have been waiting for it to be fixed since EF4.

                                          3 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 →
                                          ← Previous 1 3 4 5 17 18
                                          • Don't see your idea?

                                          Entity Framework Feature Suggestions

                                          Feedback and Knowledge Base