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 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. Clear all entities in a set.

    Need to be able to call Clear on an EntitySet to delete all entities from that set (i.e. rows from underlying table). When called as myObjectContext.MyCustomers.Clear() it would delete all rows in the underlying table.

    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…)
      1 comment  ·  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.

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

        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 →
        • Support for multiple result sets in .ExecuteFunction() and .ExecuteQuery()

          public Tuple‹T1, T2› ExecuteQuery‹T1, T2›(string query) { ... }
          public Tuple‹T1, T2, T3› ExecuteQuery‹T1, T2, T3›(string query) { ... }

          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…)
            1 comment  ·  runtime  ·  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.

            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 →
            • Support for Linked SQL Servers

              Add support for Linked servers.

              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…)
                1 comment  ·  Flag idea as inappropriate…  ·  Admin →
              • Generate separate POCO Entities

                When creating the edmx (Database First) within Visual Studio, there should be a checkbox to tell the code generators to create a separate library that contains the entities selected from the database. These can be used as domain objects/models across all layers in the application.

                Currently in EF5, you have to cobble together some hack to separate the POCO's - delete xml entries in the *.csproj and do other dangerous steps just for separation.

                EF6 should have the hooks for configuration by users within Visual Studio.

                That's the one thing NHibernate has over EF - separate POCO's

                Thanks!

                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  ·  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…

                  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  ·  tools  ·  Flag idea as inappropriate…  ·  Admin →
                  • Query serialization / deserialization

                    ** SUGGESTION **
                    Native support for query serialization and deserialization (to XML) decoupled from a concrete ObjectContext, including query parametrization and correct management of lambda expressions (e.g. using expression expansion as in LinqKit).

                    ** WHY **
                    We've developed a set of classes that allow a query to be written in the client layer and executed in the service layer via web services (with POCO entities). After the query is written normally using linq to entities and obtaining an IQueryable<T> object, this implementation transparently does the following:

                    CLIENT side:
                    - Expands the query expression tree to correctly manage lambda expressions.
                    -…

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

                      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 →
                      • Support for generic type entities

                        Pseudocode to illustrate:

                        public abstract class BaseGenericClass<T> where T : class {}

                        public class DerivedGenericClass: BaseGenericClass<Foo> {}

                        public class DerivedGenericClass: BaseGenericClass<Bar> {}

                        public DbSet<BaseGenericClass<>> genericClassDbSet;

                        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  ·  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).

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

                            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  ·  Flag idea as inappropriate…  ·  Admin →
                            • Improve performance of adding many entities to DbContext (DetectChanges, AutoDetectChangesEnabled)

                              The performance hit of adding (and possibly other operations) many entities to the context is so big, that you've introduced the AutoDetectChangesEnabled switch https://msdn.microsoft.com/en-gb/data/jj556205.aspx. This increases the code complexity and leads to nasty bugs. This is not ok and should be redesigned to work fast out-of-box. E.g. by upgrading from EF5 to EF6, due to this feature, the performance of some code has degraded by many orders of magnitude

                              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 →
                              • Native support for defining filtered unique and/or nonclustered indexes

                                IndexAttribute does not allow me to definite filtered indexes. Instead, I have to execute raw SQL.

                                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  ·  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.

                                  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  ·  Flag idea as inappropriate…  ·  Admin →
                                  • Show diagram nodes under the EDMX node in solution explorer

                                    At the moment if I want to work on a specific diagram, I have to open the default diagram in the solution explorer, open the model browser, then open the diagram I'm interested in. Can we have diagrams listed as nodes underneath the EDMX nodes in solution explorer, allowing us to go straight to the diagram we are actually interested in?

                                    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  ·  tools  ·  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  ·  Flag idea as inappropriate…  ·  Admin →
                                      • Add the ability to persist TimeSpan values (and others) as strings

                                        The immediate need is to be able to map between TimeSpan values on the CLR side and their equivalent string representations on the database side.

                                        Currently TimeSpan can only be mapped to the SQL time datatype, which does not make much sense since the time SQL type is meant for storing time-of-day while TimeSpan is meant to represent an arbitrary amount of time. Mapping between the two limits the TimeSpan to a 24 hours interval, which rarely makes sense.

                                        In our current DAL we do this by persisting TimeSpan values as strings, calling TimeSpan.ToString() on the way down and TimeSpan.Parse()…

                                        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  ·  Flag idea as inappropriate…  ·  Admin →
                                        • Allow stored procedures to be used to navigate relationships

                                          There are many developers who are in shops that don't allow non-stored procedure calls to SQL Server. It would be really nice if there was something in EF where we could select a relationship in the EF designer, go to its mapping and select a stored procedure for each role in the relationship. It might go something like this:

                                          1.We would create a relationship between two entitties, say Author and Book. Both entities would be required to expose foreign keys (the developer can make them private if they want).
                                          2.A stored procedure would be created that would navigate from each…

                                          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  ·  Flag idea as inappropriate…  ·  Admin →
                                          1 2 8 10 12 17 18
                                          • Don't see your idea?

                                          Entity Framework Feature Suggestions

                                          Feedback and Knowledge Base