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. Unique Constraint (i.e. Candidate Key) Support

    SQL Server and other databases support Unique Constraints on tables. Foreign key constraints are generally based on unique constrains on the principal side, with the Primary Key being only a special case of a unique constraint.
    The Entity Framework currently only supports basing referential constraints on primary keys and does not have a notion of a unique constraint. The idea is to have:

    • Support for specifying a unique constraint on an Entity
    • Support for specifying a foreign key associations that on the principal end specify columns(s) that comprise a unique constraint but are not the primary key,

    3,222 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…)
      57 comments  ·  runtime  ·  Flag idea as inappropriate…  ·  Admin →
    • Batch CUD support

      When SaveChanges is called, rather than sending one SQL statement per insert/update/delete, batch it all up into one SQL statement

      3,039 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…)
        22 comments  ·  Flag idea as inappropriate…  ·  Admin →

        UPDATE: We have initial batch CUD Support checked-in in our EF7 repository.

        UPDATE: We do plan to implement batch CUD support in the EF7 codebase. We are just not committed yet to doing it for the initial RTM and we are currently not actively working on it.

        Reverting status from “under review” to “no status” since we aren’t currently working on this. We will still consider it for future releases.

      • Improved SQL Generation

        I have seen simple select statements with 4 or 5 includes result in nearly 5000 line SQL statements when an equivalent hand-written SQL statement is ~15 lines. The performance of these queries along with the readability when debugging makes it an area that I would like to see the EF team focus on improving.

        2,485 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…)
          26 comments  ·  runtime  ·  Flag idea as inappropriate…  ·  Admin →

          The update for the core EF libraries that will be included in .NET 4.5 will include some improvements in SQL generation. However not all the scenarios mentioned in the comments will be addressed.

          I am going to leave this idea as open for now, until we figure out a better way to track individual scenarios, which we need to do to get more actionable data.

        • Simple type mapping or mapped type conversion support

          Currently the only conversion available in EF Core libraries 4.5 and EF 5.0 are enums mapped to integers but that is only tip of the iceberg. There is whole big feature behind - simple type mapping or conversions defined directly in mapping.

          For example what if my database contains char column with Y, N values and I want to map it to bool property directly without any additional stuff doing the conversion inside my entity? Or more complex example - what if my column contains value like en-us and I want to map it to instance of CultureInfo? There are…

          2,378 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…)
            55 comments  ·  runtime  ·  Flag idea as inappropriate…  ·  Admin →

            UPDATE: We do plan to implement type conversions in the EF7 codebase. We are just not committed yet to doing it for the initial RTM and we are not actively working on it.

            Reverting status from “under review” to “no status” since we aren’t currently working on this. We will still consider it for future releases.

          • Second Level Cache

            Entity Framework currently support only first level cache (cache for entities). I would like to see a second level cahce implemented in the next version (queries cache).

            1,962 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…)
              17 comments  ·  Flag idea as inappropriate…  ·  Admin →
            • Mapping single model to multiple databases

              Like to be able to build a domain model over data in multiple databases. With out having to manage database objects - linked servers, views etc.

              1,572 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…)
                31 comments  ·  runtime  ·  Flag idea as inappropriate…  ·  Admin →
              • Allow filtering for Include extension method

                There is no ablity to filter included objects in ObjectQuery<TSource>.Include method.
                Allow filter predicate in Include method in Entity Framework.
                I suppose this method of ObjectQuery<TSource> may have following signature:

                /// <summary>
                /// Includes related objects which meet to predicate
                /// </summary>
                /// <typeparam name="TRelation">Type of related object on another end of navigation property</typeparam>
                /// <param name="relationSelector">Expression that returns set of related objects</param>
                /// <param name="predicate">Predicate that has to be met</param>
                /// <returns>Query</returns>
                public System.Data.Objects.ObjectQuery<TSource> Include<TRelation>(Expression<Func<TSource, IEnumerable<TRelation>>> relationSelector, Expression<Func<TRelation, bool>> predicate);

                1,316 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…)
                  21 comments  ·  Flag idea as inappropriate…  ·  Admin →
                • Table-Valued Parameters support

                  TVP support for stored procedures

                  1,195 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…)
                    24 comments  ·  Flag idea as inappropriate…  ·  Admin →
                  • 794 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…)
                      16 comments  ·  tools  ·  Flag idea as inappropriate…  ·  Admin →
                    • XML data type support

                      EF full support of XML field

                      611 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…)
                        18 comments  ·  runtime  ·  Flag idea as inappropriate…  ·  Admin →
                      • TPT (Table-Per-Type) Inheritance Performance

                        Problem Description:
                        For TPT inheritance, the more subclasses you add, the time it takes to generate SQL, and the complexity of the SQL query itself, become unmanageable. With a simple base class (5 or 6 fields), and around 30 simple subclasses (2 or 3 fields a piece), it takes almost 2 minutes to generate the SQL (ObjectQuery.ToTraceString()) and execute it on the server. EF generates almost 8000 lines of SQL for a simple select query on the base class. This is because the SQL generated is a mess of crazy subselects, joins, and unions. Even with empty tables (so that…

                        599 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…)
                          8 comments  ·  Flag idea as inappropriate…  ·  Admin →
                        • Offer an in-memory provider to use as test double / fake database

                          Instead of having EF connect to SqlServer or Oracle or whatever ... have the ability to provide an InMemory provider ... so our unit tests or general development can be quick. There's no .dbf or whatever. No triggers or stored procs or views. Just list or hashset backing collections (behind the scenes). Simple, yet fast.

                          Example scenario's.

                          The common : Blog posts and Users. When a person creates a new blog post (which is represented as an entity on the edmx) and adds a User to that blog post, (ie. the user who is making the post), the inmemory context…

                          500 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 →
                          • Support interfaces as entity and complex types

                            It's unfortunate not to be able to mark interfaces for EF mapping (code first). This will allow to really abstract the implementation. Allows a unique representation of the data in the context of RIA Services (if Ria Services allows also for interface 'mapping'). This won't be very hard to implement since EF is happy when it subclasses... For the benefits: imagine you have only interfaces to declare your model. On the server side, you use EF to get your interfaces 'filled' from DB. on the client side you get those same interfaces filled by RIA services... You can reuse any…

                            480 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…)
                              13 comments  ·  Flag idea as inappropriate…  ·  Admin →
                            • Code First support for Table-Valued Functions

                              The EF team has marked the previous TVF feature suggestion as Completed saying TVF support will be included with .NET 4.5. It had 226 votes at the time. However, this excludes Code First support. Vote for this suggestion to specifically add Code First support for TVFs.

                              475 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…)
                                5 comments  ·  runtime  ·  Flag idea as inappropriate…  ·  Admin →
                              • Eager loading for properties of derived classes

                                In entity framework there should be a way to eager load (include) navigation properties of a derived class.

                                When in an data model for entity framework has a navigation property it is not posseble to eager load that navigation property besides when using OfType<> or when eager loading the derived type itself by a navigation property.
                                This could be done by using a special syntax of the include path.
                                Since a property of the base class can not have the same name as the derived class, it would also be possible to navigate to the derived class by its name.

                                465 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…)
                                  20 comments  ·  Flag idea as inappropriate…  ·  Admin →
                                • Allow default date = NOW and provider.MinDate in CSDL

                                  get asked about non-nullable date defaults frequently.

                                  The only way to set a default date in the entity data model is to put a hard date in there, a string. If you have a known default date (e.g. 1900-01-01) this is fine. But often we want NOW to be the default and there's now way to indicate that in the model. Additionally, if there was a way to indicate EF should use the providers minimum value that would be nice. Even if it meant typing "SqlServer.MinDate' into the default attribute in the property window.

                                  Even if the database knows how…

                                  464 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…)
                                    13 comments  ·  Flag idea as inappropriate…  ·  Admin →
                                  • Lazy loading of non-navigation properties

                                    At time we may require to lazy load at column level. For e.g. if we have a LOB column which could be huge, we may not want to load that upfront when the table is lazy loaded. Agreed that we can workaroudn this problem, but a straight forward way would be good to have

                                    448 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  ·  Flag idea as inappropriate…  ·  Admin →
                                    • Delete orphans support

                                      Entity Framework should support automatic deletion of orphan records, the way "all-delete-orphan" works in NHibernate.

                                      If I have a one-to-many relationship between Orders and OrderLines, and code inside the Order class calls OrderLines.Remove(orderLine), this should cause the order line to be deleted when I save changes. Currently, EF attempts to set the order line's OrderID to NULL. If the OrderID column is non-nullable, the update fails with a constraint violation error.

                                      I found this forum post in which Daniel Simmons from Microsoft says EF doesn't support this: http://social.msdn.microsoft.com/forums/en-us/adodotnetentityframework/thread/CB9C1C4A-DF12-44E4-B00A-417C80BF5453

                                      This is an important feature for an ORM, since it's difficult to…

                                      434 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…)
                                        11 comments  ·  runtime  ·  Flag idea as inappropriate…  ·  Admin →
                                      • Better support for Self-Tracking Entities

                                        The current implementation of self-tracking entities is error-prone especially when combined with disconnected scenarios, such as, when using WCF services. The reconciliation process with the ObjectStateManager is convoluted and makes it easy to trip up when saving larger aggregates with Self-Tracking Entities. I would like to see more effort put in to improve the Self-Tracking Entities template and to improve how EF and Self-Tracking Entities interact.

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