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,

    2,785 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…)
      under review  ·  47 comments  ·  runtime  ·  Flag idea as inappropriate…  ·  Admin →
    • 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,388 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…)
        25 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…

        1,858 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…)
          under review  ·  44 comments  ·  runtime  ·  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,431 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…)
            under review  ·  28 comments  ·  runtime  ·  Flag idea as inappropriate…  ·  Admin →
          • XML data type support

            EF4 full support of XML field

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

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

                372 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 →
                • 341 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 →
                  • Support for other native data types and user defined types

                    Well it has to be in the .NET Framework data types, not sure whether there would be any work to do in EF for this. Meanwhile there should be a provision to include the new data types in the backend. for e.g. Oracle can have it's own user defined types, SQLServer 2008 R2 has HierarchyID datat type which I am not sure to what datatype it would map to at the conceptual level

                    We should have provision for such types

                    340 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…)
                      12 comments  ·  runtime  ·  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…

                      302 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…)
                        under review  ·  7 comments  ·  runtime  ·  Flag idea as inappropriate…  ·  Admin →
                      • Decouple entity creation in EF and support entities without default constructors and publically settable properties

                        EF should decouple the implementation of the entity objects from the mapping functionalities. The EF team could provide the current entity creation as a default variant which can be attached to the mapper. The developer has the option to provide it's own data transfer object layer. Therefore we need to abstract the entities through interface usage an a generic naming schema (dot notation of an object model like Person.Name). So the EF would be much more flexible to use.

                        Note by Diego Vega: I am merging this idea with a few other ideas that are approximately equivalent but extend in…

                        283 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…)
                          under review  ·  8 comments  ·  runtime  ·  Flag idea as inappropriate…  ·  Admin →
                        • Flexible stored procedures support: allow mapping entities with complex types

                          So far a stored procedure cannot be mapped to an entity with complex properties. Well it can be mapped, but the execution fails at runtime. It would be great if we could map stored procedure columns to entity properties.

                          265 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 →
                          • Merge method: automatic synchronization of relationships on a disconnected entity

                            A problem encountered when an entity is instantiated using non-ef infrastructure, e.g. ASP.NET MVC model binder mechanism. Such entity is pure poco class without proxy. Updates of relationship of the entity can be only synchronized using manual approach according to MSDN(and proven by experience)
                            http://msdn.microsoft.com/en-us/library/ee373856.aspx "If you are working with disconnected objects you must manually manage the synchronization."
                            Manual synchronization is really painful approach and really not a good ORM style solution.
                            The problem even becomes critical for me in decision to migrate my application to nhibernate due to the fact that nhibernate can do such synchronization without problems http://www.codinginstinct.com/2009/11/nhibernate-feature-saveorupdatecopy.html

                            198 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…)
                              under review  ·  3 comments  ·  runtime  ·  Flag idea as inappropriate…  ·  Admin →
                            • Bring back CompiledQuery in DbContext

                              CTP 5 dropped compiled query support, this is a huge mistake. Please make sure it is there in the final product.

                              185 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 →
                              • Offer eager loading strategies

                                I supposed that eager loading currently supports only single fixed strategy and except some rare cases this strategy always joins all eager loaded data to one huge record set - at least that is what I saw so far.

                                I described the impact of such eager loading on Stack Overflow: http://stackoverflow.com/q/5521749/413501

                                It would be nice to have some control over the way how eager loading is executed with possibility to define if eager loaded data should be joined into single result set with the main data or if they should be executed in separate query.

                                Something like:

                                var data =…

                                170 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…)
                                  2 comments  ·  runtime  ·  Flag idea as inappropriate…  ·  Admin →
                                • Ability to specify NoLock and other query hints

                                  Table lock, update lock ( WITH(UPDLOCK) / FOR UPDATE ).
                                  LockMode something like NHibernate.

                                  Also should support controlling parameter sniffing

                                  http://stackoverflow.com/q/9890699/85196

                                  169 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 →
                                  • Take namespaces into account in POCO mapping

                                    This is a must for modularity. We already support this feature on our side with schemas (sql server) the only problem is EF does not take namespaces into account.

                                    167 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…)
                                      2 comments  ·  runtime  ·  Flag idea as inappropriate…  ·  Admin →
                                    • Make Entity Framework fully mockable and injectable

                                      Make Entity Framework Fully Mockable and injectable

                                      In general, mocking out the Entity Framework DAL is a big pain to accomplish. ObjectContext has no interface and the T4 templates aren't written to create interfaces for the objects they create.

                                      This hampers good unit testing and makes them less injectable.

                                      Put an interface on ObjectContext. Have the T4 Templates put interfaces around all of the objects that are generated and make sure that all objects used have interfaces so that mocking frameworks, like MOQ or Moles & Pex can automatically generate stubs to replace the objects in unit tests so that…

                                      165 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 →
                                      • Support for streams instead of byte arrays for varbinary fields

                                        Support for mapping System.IO.Stream to Binary fields

                                        160 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…)
                                          under review  ·  8 comments  ·  runtime  ·  Flag idea as inappropriate…  ·  Admin →
                                        • Extra Lazy Loading

                                          When I do user.Cars.Add() EF load all Cars for that user.
                                          user.Cars.Count() too

                                          157 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…)
                                            under review  ·  6 comments  ·  runtime  ·  Flag idea as inappropriate…  ·  Admin →
                                          ← Previous 1 3 4 5 6 7 8
                                          • Don't see your idea?

                                          Entity Framework Feature Suggestions

                                          Feedback and Knowledge Base