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.

Please consider other options besides this site:

How can we improve Entity Framework?

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. Query from entity

    The Query method on the DbCollectionEntry and DbReferenceEntry classes provides access to the underlying query that the Entity Framework uses when loading related entities. A similar Query method should be added to DbEntityEntry.

    3 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 dependent Foreign Key properties to have a StoreGeneratedPattern of Computed

      Allowing dep. FK properties of the model to be generated by the database is useful for activity auditing (e.g. user logged into the DB gets their employee ID attached to the record by a trigger in insert/update).

      I understand the issues of having the DB generate the value (the value could violate the FK), but I put that on the same level as a DBA or other admin changing values that violate the FK (since the DBA or admin is likely doing the coding of the trigger itself).

      3 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 →
      • 3 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 →
        • Allow project-wide disabling of database generation (Database.SetInitializer( null ) for Entity Framework)

          As is commonly known, code first database generation is not for deployment:
          http://programmers.stackexchange.com/questions/76082/is-entity-framework-code-first-a-bit-meaningless-useless-in-production-and-what
          and to prevent the errors when changing the database and when going to production we should use:
          Database.SetInitializer<DbContext>( null )

          This is results in quite a lot of additional code and management when there are many different tables / dbsets and the project is going through change. There is also the risk that you might forget one. It is especially onerous when using generic classes derived from DbContext, such as

          public class Records<T,U> : DbContext
          where T : Employee
          where U : AccountInformation
          {
          public DbSet<T> Employees; …

          3 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 indexers in LINQ queries

            Let us access indexers in the LINQ queries... Why do I need to save named POSTed data to an intermediate variable before I use it once to query the database? It worked fine in LINQ 2 SQL, and I have been waiting for it to be fixed since EF4.

            3 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 →
            • 3 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 →
              • Improved Table Per Concrete Type Performance

                Like the TPT improvements, seeing improvements to concrete types would be great.

                3 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 →
                • mearge all EF flavor (modle firest , code first ) so the generated code is the same

                  this leads to 2 development roads , one might have feature that the other don't , i mean :
                  model first store the relation and mapping in XML file and load it at run time ,
                  where code first uses convention or data annotation or fluent API
                  code first have data annotation , migration , where model first don't .
                  could we make both generate code first way ?

                  3 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 →
                  • Better error message for "The cast to value type ... "

                    It would be very usefull to get the name of the corresponding property or fieldname that causes the "The cast to value type 'System.Int32' failed because the materialized value is null...." exception.

                    3 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 →
                    • Persist/Query Calculated Properties (read-only)

                      This is a very useful feature that is supported in NHibernate. Given this property in the Order Entity:

                      public decimal OrderTotal
                      {
                      get { return Items.Sum(o => o.Total); }
                      }

                      EF should persist this "read-only" property which can also be used in LINQ queries.

                      var results = from order in DbSet<Order>
                      where order.OrderTotal > 100
                      select order;

                      I believe a current work around is to include an empty protected setter but that has code smell all over it.

                      3 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 →
                      • Use ICustomTypeProvider to aid in a runtime customisable multi-tenant solution

                        It is easy enough to add properties to a ICustomTypeProvider class but getting EF to recognise the added field would make producing a customisable multi-tenant solution a lot easier.

                        3 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 →
                        • 3 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 →
                          • dynamic discriminator

                            use in the discriminator column the assemblyqualifiedname to be able to store any class that extend the base entity

                            3 votes
                            Vote
                            Sign in
                            Check!
                            (thinking…)
                            Reset
                            or sign in with
                            • facebook
                            • google
                              Password icon
                              I agree to the terms of service
                              Signed in as (Sign out)
                              You have left! (?) (thinking…)
                              0 comments  ·  runtime  ·  Flag idea as inappropriate…  ·  Admin →
                            • Provide a way to auto-increment columns without the need for sprocs or raw queries

                              Loading the object in memory and incrementing a property can cause incorrect results when concurrent transactions attempt to do the same. Using optimistic concurrency can eliminate the issue, but in high traffic scenarios, it doesn't seem feasible to reload the object and attempt to increment the property again since the other transactions will be forced to do the same. I'd like to be able to send Value = Value + 1 query to the database.

                              3 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 →
                              • SqlAzureExecutionStrategy should handle all transient Azure SQL errors

                                I believe that current version of SqlAzureExecutionStrategy was developed in time of different architecture of SQL Azure (proxies handling connections). Now it does not cover some clearly transient errors, for example very common "System.Data.SqlClient.SqlException: A transport-level error has occurred when receiving results from the server. (provider: Session Provider, error: 19 - Physical connection is not usable)". See http://stackoverflow.com/questions/25998625/why-does-sqlazureexecutionstrategy-not-handle-error-19-physical-connection-i/30894154#30894154

                                3 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 →
                                • config free/unregistered providers

                                  Need the ability to use an ObjectContext (or equivelent type) with an unregistered provider. Passing in a DbProviderFactory or DbConnection would be acceptable implementations.

                                  3 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 compact frameworks

                                    support for .net CF 3.5 and 3.7 please...

                                    3 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 →
                                    • createstoredprocedure Xml ParameterBuilder

                                      CREATE PROCEDURE [dbo].[sp_DownloadItemXml]
                                      @ItemId [int],
                                      @ReturnXML XML = NULL OUT
                                      AS
                                      BEGIN ....

                                      Add System.Data.SqlDbType 'Xml' equivalent to System.Data.Entity.Core.Metadata.Edm.PrimitiveTypeKind to allow an XML parameter to be generated when calling CreateStoredProcedure.

                                      3 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 →
                                      • IObjectSet .Find() Medhod

                                        IObjectSet .Find() Medhod

                                        3 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 →
                                        • 2 votes
                                          Vote
                                          Sign in
                                          Check!
                                          (thinking…)
                                          Reset
                                          or sign in with
                                          • facebook
                                          • google
                                            Password icon
                                            I agree to the terms of service
                                            Signed in as (Sign out)
                                            You have left! (?) (thinking…)
                                            0 comments  ·  runtime  ·  Flag idea as inappropriate…  ·  Admin →
                                          • Don't see your idea?

                                          Entity Framework Feature Suggestions

                                          Feedback and Knowledge Base