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. Detect only properties that actually changed with change tracking POCO proxies

    I've noticed that in the proxied poco classes, an entity is marked as modified whenever a property is set, regardless of whether the value has actually changed. I think it would be nicer if only truly modified entities are flagged as modified.

    330 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 →
    • 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 →
          • Support for hierachical queries and HierarchyID

            One of the things that most simple business applications require is heirarchy. Whether it be a tree for data selection or a threaded comment set, Heirarchy is horrible to implement in EF and LINQ - I'd like to see methods that support it better.

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

              256 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  ·  Flag idea as inappropriate…  ·  Admin →
              • Generate database update script for Model First

                I am creating a Database with the Model First SQL Script Generation. Then later when I need to Update the Model I don't want to delete all tables and content, I want to generate an update Script.

                Its possible in EF4 with an Tool:
                http://visualstudiogallery.msdn.microsoft.com/df3541c3-d833-4b65-b942-989e7ec74c87/

                but in EF5 there is atm no possibility to update the Model with "Model first".

                Idea: perhaps try to include the SQL-Schema Comparer in EF.

                248 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…)
                  15 comments  ·  tools  ·  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

                  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…)
                    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 →
                                • Full Text Search

                                  Provide Full-Text Search capabilities similar to Lucene.Net-NHibernate

                                  153 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 →
                                  • Simple Static Delete and Update Methods

                                    Allow for simple delete and update operations that do not require multiple round trips to the database. They could be static methods on each Entity. For example:
                                    Cars.Delete(int ID)
                                    or
                                    Cars.Delete(Guid ID)

                                    This would delete a car record with the associated ID if it exists. The code generation template should be smart enough to create the static methods using the correct data type.

                                    For updates you would pass in the ID and a set of named parameters for the fields that need to be updated:

                                    Car.Update(10, {Status="Sold", ModifiedDate=DateTime.Now}

                                    I think people are doing this now using functions or executing SQL

                                    150 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 →
                                    • Vastly improve LINQ translation

                                      LINQ to SQL is the legacy alternative to EF. EF should support almost everything that L2S always did for two reasons:

                                      a) to ease migration
                                      b) because L2S was awesome and we want EF to be as well

                                      Please address the issues mentioned in this post: http://scatteredcode.wordpress.com/2011/06/21/why-entity-framework-4-1s-linq-capabilities-are-inferior-to-linq-to-sql/

                                      I did not author it, but I found many of those attempting to migrate a bug codebase. I was forced to abandon the migration because the issues were so many.

                                      148 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 →
                                      • 145 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 →
                                        • Richer collection support, including ordered collections and dictionaries of value types

                                          It would be very nice to be able to support properties which are collections of value types. Just to have an array of doubles I shouldn't need to map each value to a class. NHibernate has this feature. E.g.
                                          class Benchmark
                                          {
                                          public long Id {get; set;}
                                          public string Name {get; set;}
                                          public IDictionary<DateTime, double> Returns {get; set;}
                                          public int[] Vector {get; set;} // preserve the order too
                                          }

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

                                          Entity Framework Feature Suggestions

                                          Feedback and Knowledge Base