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. Add support for dynamically extended queries as per LinqKit

    LinqKit has shown that is possible to make the creation of queries much more dynamic, with them being composed at run time dependent on external conditions. nHibernate is good at this and LinqKit helps, but it would be nice to have an official solution.

    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 →
    • 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.

      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 →
      • Bulk Object Graph Persistence

        I would like to see the ability to persist an entire object graph in one DB call. Currently it is way to chatty with the DB which makes it really slow to persist.

        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…)
          3 comments  ·  runtime  ·  Flag idea as inappropriate…  ·  Admin →
        • Use CTE (with clause) instead of derived tables in generated queries.

          SQL Generated code would be much more readeable if you would use common table expressions instead of derived table. Just choose the name you want for the CTE and move the code generated for the derived table into the CTE, and replace the derived table expression by the name of the CTE. The resulting code is then no more indented. You can also take the opportunity to properly name the CTE to give an hint about which part of the linq expression result in the CTE generation. This improvement should not be complex to implement, and would help us and…

          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 →
          • Foreign key (from attribute and fluent) without navigation property

            Right now you have to define a navigation property set a foreign key constraint on a column.
            For people that want to achieve some independence from EF (using the repository pattern, for example, and a key-value store as a possible alternative), plainer POCOs with just ids are important.
            For example, with the repository pattern, I am right now able to use the same data classes and the same IRepository for an EF backed data store and a Redis-backed one.

            Defining a foreign key without the navigation property is still important and useful for data integrity.

            If could be something like …

            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 →
            • Support read-only mapping to tables without key

              Allow mapping of database views without requiring the Key Attribute

              When mapping entitis to Views, it´s common that no Key can be set, bescause the view does not provide it and you can´t map it. The idea is:

              * Make it possible to map to Views (or tables) in a read only fashion that does not require the Key Attribute

              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 →
              • 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…)
                  1 comment  ·  runtime  ·  Flag idea as inappropriate…  ·  Admin →
                • Instantiate "many" nav properties with empty list

                  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…

                  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…)
                    4 comments  ·  runtime  ·  Flag idea as inappropriate…  ·  Admin →
                  • 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.

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

                      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…)
                        1 comment  ·  runtime  ·  Flag idea as inappropriate…  ·  Admin →
                      • 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
                        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 →
                        • Interception Mechanism

                          Allow specifying an interceptor (Castle, LinFu, Sprint.NET, etc) for modifying materialized entities. This allows injecting interfaces such as INotifyPropertyChanged, IEditableObject, etc.

                          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…)
                            1 comment  ·  runtime  ·  Flag idea as inappropriate…  ·  Admin →
                          • ColumnAttribute to set the name of a navigation property backing onto a real column

                            [Column("OwnerId")]
                            public virtual User Owner { get; set; }
                            some interest was expressed by the team on this so it may be in...

                            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 →
                            • Provide means to clear the database

                              Provide a method on the Database class to remove all data from the database without knowing anything about the underlying physical database schema, relationships and constraints.

                              This is critical in order to effectively test EF related code. While one way is to recreate the database every test, it has security and performance implications.

                              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 →
                              • Property to inform when entity is being materialized

                                If you perform business logic in the entitys OnPropertyChanged event handler, eg. calculating some related properties or changing a state property when certain properties are changed, your code is also run when the entity is fetched from the database. This is not a real change of the entity, it is just being loaded. It would be nice if the EntityObject class had a property bool IsMaterializing that was true so you could break out of the OnPropertyChanged handler.

                                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 →
                                • 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 →
                                  • 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 →
                                      • Partial SaveChanges

                                        Should be able to SaveChanges of certain entities while leaving the other entities in Added etc. mode, this is useful when you want to save data in a page that some other parts of the page contain invalid data that can't be saved.

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

                                          Entity Framework Feature Suggestions

                                          Feedback and Knowledge Base