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. Allow inserting new entities with predefined identity column values (INSERT_IDENTITY)

    Especially for migration projects it would be useful to allow entities to be saved with predefined identity values.

    Until now you have to use ADO.NET to do this.
    SET IDENTITY_INSERT TableName ON
    INSERT INTO TableName (IdColumn, Column1)
    VALUES (234, 'Value')

    I would like to tell the DbContext to use this feature when saving new entities.

    4 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 →
    • Add Entity Framework Releases to Microsoft Reference Source Server

      Make it quick and easy to see the source code during debugging and allowing Visual Studio to load the source on demand as it does for the core .net framework.

      4 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 →
      • Better support for mainframe databases like DB2

        Please add support for connecting to and using mainframe databases like DB2. We can't wait for IBM to get their act together and produce a usable EF provider.

        4 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 →
        • Create a convention to automatically convert null string properties on a model to empty strings

          Create a convention to automatically convert null string properties on a model to empty strings

          4 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 →
          • Database VIEW creation support and specific mapping of entites to views.

            Currently, to get Code First to create a database with a VIEW, the CREATE VIEW sql statement must be hacked a couple of Context.Database.ExecuteSqlCommand's. One to drop the table that EF created for the entities you're mapping to it and another to create the view using the same name as the table EF assumes is still there.

            When mapping an entity to a view, you have to use modelBuilder.Entity<T>.ToTable and treat the view as a table. Entity Framework assumes the view is still a table and assumes it's read/write. A new method of .ToView might be added to tell EF…

            4 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 →
            • get context from entity

              some times we need to know the context from entity

              4 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 →
              • TPH should use Discriminator Expression

                Allow via DataAnnotation or Fluent API which column in an abstract class is the Discriminator. For example, in a Vehicle table you could identity a VehicleType [int] as the discriminator.

                Then in derived class (e.g., PassengerCar) you could identity what values (or set of values) distinguish the type in the table. For example, [DiscriminatorExpression("VehicleType in (1,4,7,10)")]

                4 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 →
                • Persistant Ignorant Base Types

                  Supporting base types that don't need database serialization would be ideal. For instance, an abstract class

                  "Layout", and then the classes that inherit from it are persisted in the database, but the Layout class is just an abstract template.

                  4 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  ·  tools  ·  Flag idea as inappropriate…  ·  Admin →
                  • Visual Studio Database Project integration

                    Support for updating a Visual Studio Database Project(s) instead of updating the db directly with an ad-hoc file.

                    Currently 4.0 allows us to generate our database schema from the model but its capabilities are limited and destructive:
                    unique keys – no support
                    schema generation – destructive

                    Database Projects for Visual Studio has already matured and more importantly has the capability of updating schemas without being destructive to the data. It would be nice to see the next designer integrate fully with this product rather than re-invent the wheel. For those of us that manage our databases using Database Projects this…

                    4 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 →
                    • Suppress specific errors/warnings

                      When doing "Model First" development THERE IS NO BACKING STORE. I don't want to create a phony one. I don't want a store or any mapping to one ... period. I'll deal with that when the time comes. But I should be able to model away w/o a map or store.

                      Ok ... you should provide a warning ... as you do. during validation I get a raft of 11007 and 11008 "errors" and a 2062 error during compilation.

                      But I should be able to suppress those warnings and errors as well.

                      In Model First you do NOT specify mapping…

                      4 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 →
                      • Make objectcontext work with multiple edmx definitions

                        When using a framework with seperate database tables it is difficult the keep them apart. We have to merge them for each project to make joins possible but then we have to backport each change to the original framework database. It would cleaner if you can use one objectcontext for the 2 edmx files or make sub-edmx files or include them.

                        4 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 →
                        • Better support for modeling and regenerating existing database views

                          The current database first support for views is not very good. I would like to see: readonly views where no key is assumed, updatable views where key can be selected, and at least an remembering of the actual create view syntax so that "generate database from view" will create a view and not a table. I often import a database view into my model and often do "generate database from model" to create a new empty database I can compare to production to make sure they are in sync. To do the latter, I have to delete all the sql…

                          4 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 →
                          • Allow foreign key columns to be shared between a subset of TPH subclasses

                            Scenario in the post http://entityframework.codeplex.com/workitem/583 works only for columns that are not foreign keys.

                            For example we have BaseEntity and three inherited entities:
                            InheritedEntity1.Name
                            InheritedEntity2.SpecialStatus
                            InheritedEntity3.SpecialStatus

                            SpecialStatus is entity stored in separate table.

                            BaseEntity table will have columns 'Name', 'SpecialStatus_Id', 'SpecialStatus_Id1'

                            Try to change the name of the column:
                            modelBuilder.Entity<InheritedEntity2>().HasOptional(p => p.SpecialStatus).WithOptionalDependent().Map(i => i.MapKey("SpecialStatus_Id"))
                            modelBuilder.Entity<InheritedEntity3>().HasOptional(p => p.SpecialStatus).WithOptionalDependent().Map(i => i.MapKey("SpecialStatus_Id"))

                            and get an ModelValidationException:
                            "One or more validation errors were detected during model generation:
                            SpecialStatus_Id: Name: Each property name in a type must be unique. Property name 'SpecialStatus_Id' is already defined.
                            "

                            4 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 more validation rules

                              Besides data annotations also make it possible to define custom annotations, inter entity rules, security and inter record rules and more. For example: http://www.softfluent.com/images/cfe-screens/07-cfe_addrule.png

                              4 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 →
                              • Cascade Delete with Triggers

                                Using triggers for cascade delete/set allows for multiple cascades on the same table where the built-in sql server cascade does not

                                4 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 →
                                • 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).

                                  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 →
                                  • Collation support

                                    Currently strings are compared via default database collation or column collation when the comparison is translated to SQL. But they are compared to be binary equal when the code is executed in CLR.

                                    So adding .ToList() before .Select() may suddenly change the result of comparison. And the tests with mocked IQueryables also work differently from the database translated queries.

                                    Also it's sometimes required to compare strings using different collation. Currently that's only possible if you load the entire data into memory first and compare in CLR. However, even that case is troubling since there is no exact equivalent of SQL…

                                    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 Mapping at runtime

                                      support EF for dynamic mapping at runtime via a strait-forward API for creating a table and map it to model (for Code First). this is useful for Enterprise level application such as BPMS, Felixble CMS and ...

                                      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 →
                                      • Generate database from model - create database itself if necessary

                                        Just like it used to be back ago before entity framework started where generating sql didn't require creating the database. When generating a database from model and selecting a connection string, include in the script the creation of the database itself if missing.

                                        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 →
                                        • Specify order of SQL Insert/Update statements

                                          Sometimes we find ourselves fighting against EF's algorithm for Insert/Update statements. It doesn't always get it right, or we just want more control, which is when it would be useful to override or give "hints" to it on what should be done.

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

                                          Entity Framework Feature Suggestions

                                          Feedback and Knowledge Base