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. Be able to configure initial value for identity column

    Currently when configuring Identity columns we can't declare the initial value. It would be nice to add an option in order to specify the initial value. This is not respected when we reverse engineer an existing database as well

    19 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 →
    • Global improvement of error messages

      Errors have to be much more specific. For example.

      The operation failed: The relationship could not be changed because one or more of the foreign-key properties is non-nullable. When a change is made to a relationship, the related foreign-key property is set to a null value. If the foreign-key does not support null values, a new relationship must be defined, the foreign-key property must be assigned another non-null value, or the unrelated object must be deleted.

      Which relationship was the problem. Without this information it takes a long time to debug. Do you really expect production systems to be maintainable…

      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  ·  Flag idea as inappropriate…  ·  Admin →
      • Support for OPTION (RECOMPILE) on generated queries

        There are many scenarios where parameter sniffing in SQL server creates serious performance problems. This is very problematic with many EF generated queries, since there is no control that allows you to tell the database optimizer not to use the parameter values or cache a plan. A simple mechanism to hint OPTION (RECOMPILE) on the generated queries would solve most of these issues.

        A more sophisticated solution that would allow the generated sql to leverage (Optimize for Unknown) would also be useful.

        Parameter sniffing and the related performance problems are a very prevalent issue with SQL server and if you…

        18 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 common BCL methods such as DateTime.Date

          Entity Framework should support using very common BCL features such as DateTime.Date in LINQ queries. Right now this requires the use of the special TruncateTime function.

          The problems are as follows:
          - This feels unnatural.
          - It also is a problem when migrating from LINQ to SQL which did support DateTime.Date.
          - It makes moving code across LINQ providers harder (e.g. move a piece of code from LINQ to objects to EF in order to remote it to the SQL Server)

          Other common features should be supported as well. For example DateTime.Year or TimeSpan stuff.

          Some are already supported such…

          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  ·  Flag idea as inappropriate…  ·  Admin →
          • Provide access to ModelBuilder for Database First

            Our database structure is set up in such a way that all tables contain soft-deleted columns and most contain an owner account key column.

            Both of these provide a level of filtering we would like to let Entity Framework take care of for us at a global level, instead of always writing "&& t.Deleted == false && t.Owner == LoggedInOwnerKey" on our linq join/where clauses.

            This is currently possible with Code First, when you use the DbModelBuilder during the DbContext.OnModelCreating() but that method is not available when using EDMX strategy.

            All we are doing with the DbModelBuilder is adding System.Data.Entity.ModelConfiguration.Conventions.IConventions…

            16 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 →
            • Convert.Toint

              Allow some sort of way to cast columns, like "MyContext.MyEntitys.Where(e=>Convert.ToInt(e.GenericStringField) == 10",
              and the SQL would be
              "Select * from table where Cast(GenericStringField as int)=10"

              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 →
              • Left Join

                Please iclude LeftJoin, now when I must to do LeftJoin, i must use GroupJoin instead. Writing GroupJoin code is very hard to see. So I prefer LeftJoin, like context.Join(...) so now is context.LeftJoin(...)

                1 vote
                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 →
                • Required / MinLength should not allow empty strings

                  To my knowledge, the RequiredAttribute data annotation for string types only results in the corresponding database table column being created as NOT NULL.

                  I believe this is not sufficient. Moreover, it is in conflict with user interface layers, like MVC, which cannot reliably discern between an input being null or an empty string.

                  So I'd like to suggest to amend the behaviour of the RequiredAttribute so that it will additionally create the following T-SQL CHECK constraint: CHECK (LEN(LTRIM(RTRIM( {columnName} ))) > 0).

                  See here for full discussion:

                  https://entityframework.codeplex.com/discussions/572641

                  1 vote
                  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 →
                  • Ability to place manual code in a seperate file for SSDL and CSDL away from auto-generated code such as custom functions

                    It would be nice to be able to place custom / manual code such as functions inside a separate file instead of placing the code in the auto-generated EDMX file.
                    This way all of our "developer" code is away from the "auto-generated" code and can easily be found / read.

                    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  ·  Flag idea as inappropriate…  ·  Admin →
                    • Check linked tables

                      https://social.msdn.microsoft.com/Forums/en-US/0ad264b8-d541-4abe-acbd-6e1178297b2a/linked-tables-and-sqltableexistencechecker?forum=adodotnetentityframework

                      replace SQL-statement in SqlTableExistenceChecker

                      command.CommandText = @"
                      SELECT COUNT(*)
                      FROM sys.objects t INNER JOIN
                      sys.schemas s ON s.schema_id = t.schema_id
                      WHERE s.name + '.' + t.name IN ("+ modelTablesListBuilder + @")
                      OR t.name = '" + edmMetadataContextTableName + "'";

                      1 vote
                      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 →
                        • Hook to modify LINQ tree

                          This is similar to the idea of modifying a generated SQL. Except that it applies to an earlier stage. I can imagine a scenario where a third party may come up with a really good LINQ optimizer.

                          1 vote
                          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 →
                          • code first support for view

                            allow to define a view by code first.

                            actually we can map an entity to a view but it then becomes nasty to:
                            - generate the database,
                            - migrate the database
                            - evolve the schema in general

                            It should be possible to:
                            - declare a DbSet that does not involve a table creation
                            - declare a view, with a linq query for example, that allows view creation.

                            For DbSet if should be a convention: if table name starts with vvv then it is a view, do not create a table

                            For view creation... no idea actually.

                            6 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 foreign key relationships to be configured from within code first Conventions

                              I'm currently in the situation where I need to create a foreign key relationship for about 40 entities in my edmx back to a common "Users" table. I'd like to be able to solve this problem using Conventions, but it appears I cannot access the HasRequired or HasOptional functions from within a convention. I believe making these functions available would be a real time saver.

                              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  ·  Flag idea as inappropriate…  ·  Admin →
                              • DbContext.Database Interface

                                Please please please....

                                Can we have DbContext.Database Interfaced so that we can unit test our EF code first operations on DbContext.Database

                                thanks!
                                Dean

                                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  ·  Flag idea as inappropriate…  ·  Admin →
                                • Table splitting without primary key

                                  Should I have entities that use table splitting for storage, but do use a foreign key that is not the primary key, I want to be able to bring and store the data of them with the same structure I use for table splitting in fluent API as I do now with primary keys.

                                  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  ·  Flag idea as inappropriate…  ·  Admin →
                                  • Persistent caching of auto-compiled queries

                                    I know that EF code first automatically compiles queries and caches the results. But "Cold" queries are so slow.. Is possible to persist auto-compiled queries somewhere in the database so EF won't need to re-compile them again if that cache is lost (app restarted).

                                    6 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 →
                                    • sequence

                                      support sequence, not only for key, but as a common field/column/property. This should be mapped, in sql server case, to CREATE SEQUENCE.

                                      1 vote
                                      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 →
                                      • Ability to hook into ValidationContext creation and set ServiceContainer

                                        I'd like to set the IServiceProvider in the ValidationContext constructor, so that I can access validation logic outside the IValidatableObject.Validate() method (and within custom data annotations) in a loosely coupled manner.

                                        As far as I can see, ValidationProvider.GetEntityValidationContext() passes a null for the IServiceProvider and there is no way to override/"hook into" this method or InternalEntityEntry.GetValidationResult() from the public API.

                                        Something like what ASP.NET MVC or Web API does with DataAnnotationsModelValidatorProvider or ValidatableObjectAdapter might be nice.

                                        1 vote
                                        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 →
                                        • Isolate the migrations from EF

                                          The migrations in EF is great. I'd love to see it isolated, so it can be installed seperatly.

                                          Not every project needs the full EF (in DDD layer, Migrations isn't required, but my .Data or DAL layer needs it) and this would make it easier to use tools like Dapper (that doesn't have a Migrations included)

                                          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  ·  tools  ·  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