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. Improve Database First Support

    Code First is no match for real life situations and also Proxies create lot of runtime problems.

    We use Dictionary<Type,object> to store Lambda Expressions that are designed to act as Filters for one type. Here is the problem, at runtime code first entity type is a dynamic type leading to following problems.

    1. Dynamic Type implementation is hidden.
    2. It does not support INotifyPropertyChanged
    3. It does not allow us to inspect/validate property with partial methods which we were able to do with Database First (EDMX) Model.
    4. CreateSourceQuery is hidden, sometimes we want to only execute Any or inspect…

    12 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 →
    • Object graph deep clone and object shallow Clone

      It would make sense to allow shallow and deep cloning as a default requirement. There are currently some work-arounds, like serializing and then deserializing or even detach and re-attach, but each has their downfalls and it makes sense to me to include such functionality in by default to ensure highest performance and stability

      11 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 →
      • Interchangeable Backing Database

        I would like to write my code against the EF and have it work with SqlServer Express and SQlServer Compact (or even MySQL and Oracle). It would be great if I could swap these out at runtime, even, pointing to different databases as needed. This would require some improvements to SQLServer Compact, but also some improvements to EF.

        11 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 →
        • Improve Model First: allow choosing inheritance strategy on a case by case basis

          In my models, there are hierarchies that are persisted using TPT while others are persisted using TPH. It would be great if we could choose the strategy and then have Generate Database From Model create the tables depending on our choice.

          11 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 →
          • 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!

            11 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 →
            • Stop DefiningQuery being overwritten by edmx designer

              The defining query element in the edmx XML needs adding by hand, but when reusing the update model from database it is overwritten.

              It was be very useful if the defining queries are not overwritten, as we primarily work in a database first way... so the team isn't familiar with the edmx xml... however we have specific features requiring DefiningQuery which could be overwritten often... it means that DefiningQuery couldn't be a long term solution for us as it'll cause to much pain to producitvity & gotcha bugs.

              11 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 →
              • For char/nchar and varchar/nvarchar columns use the actual column type and size in the parameter definition

                I can see that EF uses varchar(8000) for the parameter instead of the actual type (char(6) in a particular case). Would it be possible for EF to use the actual column type and size instead of varchar(8000) or nvarchar(4000)?

                11 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 →
                • Custom Accessors (Getters/Setters) in CodeFirst

                  I should be able to put basic data validation on all of my public fields.

                  10 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 →
                  • Merge EDMX designer with Class Designer

                    Visual Studio already contains Class Designer and UML Class Desinger. I don't need another so merge all them

                    10 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  ·  tools  ·  Flag idea as inappropriate…  ·  Admin →
                    • Support all mapping inheritance strategies

                      Support all mapping inheritance strategies, well documented, as mentioned here: http://www.agiledata.org/essays/mappingObjects.html

                      10 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 →
                      • Use multiple result sets to handle Include statements

                        Currently, EF uses a flat query in order to populate navigation property values when using eager loading via the Include statement. While this is acceptable in some (perhaps many) cases, there are a lot of cases where this produces unacceptable queries, whether from a size or performance perspective.

                        While this performance bottleneck can be partially avoided by using LoadProperty, this is

                        a) less expressive and more verbose
                        b) potentially more expensive, as it requires a round-trip for every property on every entity

                        Instead, please allow us the option of having EF generate multiple SELECT statements to address each navigation property

                        10 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 →
                        • Better auditing interception

                          Together will all the fabulous features you are introducing I think it could be find room also for a sort of Audit System more business oriented.
                          We love the new Log & Interceptor hooks but we also need to pull out of the DbContext an easy POCO object based on 3 level of entities like this:

                          (S)avedChangset (1 instance for every SaveChanges() call with at least Time, User, Application & Session Info)
                          (E)ntities (a collection of the Entities changed within the same "Saved Changset" with at least TableName & PK)
                          (A)ttributes (a collection of Attributes changed within the same "Entity",…

                          10 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 →
                          • Generate the Association objects based on the Foriegn Key Column Name

                            Generate the Association objects in a model based on the Foriegn Key Column Name rather than "Association1", "Association2" etc

                            10 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  ·  Flag idea as inappropriate…  ·  Admin →
                            • Ability To Create Read-Only Entities

                              There are times I want to show data like a report where I don't need all the required fields from the DB because I will NEVER write the data back. It would be nice to be able to create an entity, limit which CRUD operations it supports, and allow some required fields to not be present in the entity if I don't support CREATE or UPDATE...

                              10 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 →
                              • Code First better attributes

                                * Decimal Scale/Precision
                                [Column(DecimalScale=18, DecimalPrecision=2)]

                                * Nullable indication (For string is essential):
                                [Column(NotNull = true)]

                                * All in one:
                                [Column("TestName", NotNull = false, MaxLength = 250, MinLength = 3, Default = ""])
                                public String Name { get; set; }

                                [Column(NotNull = true, MaxLength = 0, Default = 0])
                                public int Count { get; set; }

                                10 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 →
                                • System.Data.Entity.DbSet<TEntity>.Create() method overload for taking n parameters

                                  The idea would be to overload Create() method on DbSet so as to take any parameters, resolving to the constructor tha best fits, like so

                                  public TEntity Create(params object[] args);

                                  (I understand the generated proxy for change tracking and nivigational properties support should honor all constructors defined on the TEntity type)

                                  This would allow for a much cleaner (and layarable) DomainModel. Entities may now be created from required values and the need to set those values (i.e. the need for public setters) after the creation dissapears.

                                  10 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 →
                                  • Define RelatedProperty on an inherited foreign key

                                    Allow mapping to entity in a derived class based on a property in base class.

                                    Normally, we create a [RelatedTo] property for a foreign key defined in the same class.

                                    But it would be quite handy to be able to define [RelatedTo] on a Foreign Key defined in the base class.

                                    10 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 →
                                    • Option to use Inner Join SQL when Eager Loading (AKA IncludeRequired method)

                                      When trying to load related entities using the "Include" eager loading feature of EF, it always generates SQL that uses an LEFT OUTER JOIN e.g.

                                      from m in Customer.Includes("Orders")

                                      will always generate the SQL:

                                      SELECT ......
                                      FROM Customers
                                      LEFT OUTER JOIN Orders....

                                      This is not always desirable, especially when you only want to retrieve Customers that have at least one or more related Orders. By forcing the generated SQL to always use LEFT OUTER JOIN, it's going to load all Customers regardless of whether they have related Orders or not. This can become extremely inefficient, especially when there are lots…

                                      9 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 →
                                      • 9 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 →
                                        • Support ignoring columns with database provided default value

                                          If a database defines a default for a column then the column does not need to be mapped to a conceptual schema property anymore. The column is optional (like nullable columns) and the model should validate even if no mapping for the column is defined.

                                          9 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 →
                                          1 2 6 8 10 18 19
                                          • Don't see your idea?

                                          Entity Framework Feature Suggestions

                                          Feedback and Knowledge Base