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. Support optional complex type

    For example: Class Foo has a property named Bar and that property is a reference to the complex type ComplexBar. It would be great if Bar could be left null in cases when a "user/whatever" does not have any ComplexBar information. The benefit is that ComplexBar can have required properties and other validation that only applies when the property Bar is not null. If it is null then that validation is not triggered because it does not apply. If I want Bar to always have a value then I can flag it as required, and it will behave like complex…

    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 →
                    • 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 →
                        • Optional Convention that assigns Default Value to not nullable types

                          When using code first with an existing database, the "can not assign null to a non nullable type" exception can be realy painfull, because the compiler gives no warning, when i project a int? to a int.

                          It would be very usefull to have a Convention / Configuration that enables the automatic use of GetValueOrDefault for these cases.

                          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 →
                              • A Collection which automatically sets the parent property on add

                                class Product {
                                Category Category;
                                }
                                class Category {
                                [ParentProperty("Category")]
                                ParentHashSet Products
                                }

                                var prod = new Product();
                                var cat = new Category();

                                cat.Products.Add(prod);
                                Assert.AreEqual(cat, prod.Category);

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

                                  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 →
                                  • Materialized event but where is the De-materialize event or override?

                                    We need to encrypt data (in use via WPF databinding) during the EF4.2 context.SaveData() process. Can't find a place to encrypt without the UI showing the encrypted data. We need a De-materialize or something that allows encryption without affecting the UI. If it's already available, I can't find it. Essentially need the opposite of Materialized event.

                                    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…)
                                      1 comment  ·  runtime  ·  Flag idea as inappropriate…  ·  Admin →
                                    • Support ObjectContext.Translate on joined result sets

                                      We sometimes end up doing 20 or more result sets in a single stored proc. Many times, a large majority of these are to bring back a single entry for each navigation property mapping.

                                      I would like to see a "wide" translate function.
                                      If a query has:
                                      SELECT a.*, b.*, c.*, d.*

                                      I'd like to see a version of Translate that can map each row to 4 separate object types, using the assumption that all of object A's columns are first, followed by B's, etc.

                                      This would greatly reduce the size of our stored procs, though there could be a…

                                      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 →
                                      • Logging of underlying stored procedure and actual SQL call

                                        In production environments, there is always a requirement to log the underlying SQL calls when a WCF/Web site calls database and executes store procedures or any other SQL statement. Right now, via Entity framework there is no way that we can retrieve the actual SP call so that it can be logged for trouble-shooting purposes.
                                        It would be great if the product team can create some handle to get this information!

                                        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 →
                                        • eager loading with raw sql queries

                                          When I have relation between two tables, the only way that I have to include in the collection of the main table the information of the relation tables is to use the Include method.

                                          This makes me to use linq to SQL, that has a low efficient.

                                          However, I like to create the t-sql query and use raw query, but in this case, the only way to do an eager loading is doing aditional queries, one for each relation in the main table. So is a cost in connections to the database when the best idea is to do one…

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

                                          Entity Framework Feature Suggestions

                                          Feedback and Knowledge Base