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 an Entity Framework Factory similar to the ADO.Net Provider which allows easy swapping betwe

    Provide an Entity Framework Factory similar to the ADO.Net Provider which allows easy swapping between different Entity Framework models such as SQL Server, Oracle, MySQL, DB2 etc. simply by providing the appropriate database provider information in a manner similar to the current ADO.Net Database Provider Factory.

    4 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 →
    • Add attribute for federated tables

      Add a "FederatedOn" attribute to the "Table" data annotation so Code First entities can be associated to a SQL Azure Federations federated member. For instance: [Table("Pessoas", FederatedOn = "TenantId=TenantId")]
      As an alternative, allow an equivalent attribute to be declared on the entity property that is the federation distribution key (e.g. the TenantId property).

      4 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 →
      • Eager Loading With Filters

        We should be able to specify what we want to include inside the include statement. This way, if we have a lot of information, we will not have a performance hit.

        For example:

        var blogs1 = context.Blogs
        .Include(b => b.Posts)
        .ToList();

        This is fine, but imagine you have a LOT of posts. If you want to have only Posts from today, why not having something to filter it down directly from the SQL.
        var blogs1 = context.Blogs
        .Include(b => b.Posts, d=>d.Date>=DateTime.Now)
        .ToList();

        4 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 →
        • Improve conditionals on Table-per-Hierarchy

          It never works when your conditionals are based on a int column so where Type=1 etc. Only seems to work for when some column Is Null. It complains about mapping when you try and do this. Seems impossible to work around

          4 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 inserting new entities with predefined identity column values (INSERT_IDENTITY)

            Especially for migration projects it would be useful to allow entities to be saved with predefined identity values.

            Until now you have to use ADO.NET to do this.
            SET IDENTITY_INSERT TableName ON
            INSERT INTO TableName (IdColumn, Column1)
            VALUES (234, 'Value')

            I would like to tell the DbContext to use this feature when saving new entities.

            4 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 →
            • Add Entity Framework Releases to Microsoft Reference Source Server

              Make it quick and easy to see the source code during debugging and allowing Visual Studio to load the source on demand as it does for the core .net framework.

              4 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 →
              • Better support for mainframe databases like DB2

                Please add support for connecting to and using mainframe databases like DB2. We can't wait for IBM to get their act together and produce a usable EF provider.

                4 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 →
                • Create a convention to automatically convert null string properties on a model to empty strings

                  Create a convention to automatically convert null string properties on a model to empty strings

                  4 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 →
                  • 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…

                    4 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 →
                    • get context from entity

                      some times we need to know the context from entity

                      4 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 →
                      • TPH should use Discriminator Expression

                        Allow via DataAnnotation or Fluent API which column in an abstract class is the Discriminator. For example, in a Vehicle table you could identity a VehicleType [int] as the discriminator.

                        Then in derived class (e.g., PassengerCar) you could identity what values (or set of values) distinguish the type in the table. For example, [DiscriminatorExpression("VehicleType in (1,4,7,10)")]

                        4 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 →
                        • Persistant Ignorant Base Types

                          Supporting base types that don't need database serialization would be ideal. For instance, an abstract class

                          "Layout", and then the classes that inherit from it are persisted in the database, but the Layout class is just an abstract template.

                          4 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  ·  tools  ·  Flag idea as inappropriate…  ·  Admin →
                          • Visual Studio Database Project integration

                            Support for updating a Visual Studio Database Project(s) instead of updating the db directly with an ad-hoc file.

                            Currently 4.0 allows us to generate our database schema from the model but its capabilities are limited and destructive:
                            unique keys – no support
                            schema generation – destructive

                            Database Projects for Visual Studio has already matured and more importantly has the capability of updating schemas without being destructive to the data. It would be nice to see the next designer integrate fully with this product rather than re-invent the wheel. For those of us that manage our databases using Database Projects this…

                            4 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 →
                            • Suppress specific errors/warnings

                              When doing "Model First" development THERE IS NO BACKING STORE. I don't want to create a phony one. I don't want a store or any mapping to one ... period. I'll deal with that when the time comes. But I should be able to model away w/o a map or store.

                              Ok ... you should provide a warning ... as you do. during validation I get a raft of 11007 and 11008 "errors" and a 2062 error during compilation.

                              But I should be able to suppress those warnings and errors as well.

                              In Model First you do NOT specify mapping…

                              4 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 →
                              • Make objectcontext work with multiple edmx definitions

                                When using a framework with seperate database tables it is difficult the keep them apart. We have to merge them for each project to make joins possible but then we have to backport each change to the original framework database. It would cleaner if you can use one objectcontext for the 2 edmx files or make sub-edmx files or include them.

                                4 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 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.
                                  "

                                  4 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 →
                                  • Support more validation rules

                                    Besides data annotations also make it possible to define custom annotations, inter entity rules, security and inter record rules and more. For example: http://www.softfluent.com/images/cfe-screens/07-cfe_addrule.png

                                    4 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 →
                                    • Cascade Delete with Triggers

                                      Using triggers for cascade delete/set allows for multiple cascades on the same table where the built-in sql server cascade does not

                                      4 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 →
                                        • Collation support

                                          Currently strings are compared via default database collation or column collation when the comparison is translated to SQL. But they are compared to be binary equal when the code is executed in CLR.

                                          So adding .ToList() before .Select() may suddenly change the result of comparison. And the tests with mocked IQueryables also work differently from the database translated queries.

                                          Also it's sometimes required to compare strings using different collation. Currently that's only possible if you load the entire data into memory first and compare in CLR. However, even that case is troubling since there is no exact equivalent of SQL…

                                          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 →
                                          • Don't see your idea?

                                          Entity Framework Feature Suggestions

                                          Feedback and Knowledge Base