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.
-
Intellisense for Entity Data Source expressions
Provide Intellisense when typing in expressions for the Entity Data Source such as the Select, Where, OrderBy etc.
5 votes -
ColumnAttribute to set the name of a navigation property backing onto a real column
[Column("OwnerId")]
public virtual User Owner { get; set; }
some interest was expressed by the team on this so it may be in...5 votes -
Weak references in the object context
Weak references would allow the context to cache objects but allow the caller can use a single context without wasting memory.
Example:
An embedded device where there is no clean unit of work. When something is loaded into the device it must process it, and when that something is done the user may remove it at some later point. It processes many somethings simultaneously, up to maximum capacity.For now, we either use NoTracking objects or create a context for each object. This induces a lot of unnecessary overhead.
A weak reference would mean one context, no memory growth, but…
4 votes -
Provide means to clear the database
Provide a method on the Database class to remove all data from the database without knowing anything about the underlying physical database schema, relationships and constraints.
This is critical in order to effectively test EF related code. While one way is to recreate the database every test, it has security and performance implications.
4 votes -
Improved API for Migrations
The API for DbMigrator is lacking. I would like to see .UpOne(), .DownOne(), .Up(n), .Down(n) methods to attempt to perform that number of migrations.
.Update("0") is an odd-looking way to completely thrash the DB. Something like .RollbackAll() would be a very simple implementation and have a much clearer name.
Having .Update() take an additional optional parameter to completely rollback first, and apply all migrations from scratch might be very nice, especially in a test or development environment.
Generating an SQL script for logging purposes and then performing the DB migration must currently (I believe) be done in two steps. A…
4 votes -
Property to inform when entity is being materialized
If you perform business logic in the entitys OnPropertyChanged event handler, eg. calculating some related properties or changing a state property when certain properties are changed, your code is also run when the entity is fetched from the database. This is not a real change of the entity, it is just being loaded. It would be nice if the EntityObject class had a property bool IsMaterializing that was true so you could break out of the OnPropertyChanged handler.
4 votes -
Provide an Entity Framework Factory similar to the ADO.Net Provider which allows easy swapping betwe
Provide an Entity Framework Factory similar to the ADO.Net Provider which allows easy swapping between different Entity Framework models such as SQL Server, Oracle, MySQL, DB2 etc. simply by providing the appropriate database provider information in a manner similar to the current ADO.Net Database Provider Factory.
4 votes -
Add attribute for federated tables
Add a "FederatedOn" attribute to the "Table" data annotation so Code First entities can be associated to a SQL Azure Federations federated member. For instance: [Table("Pessoas", FederatedOn = "TenantId=TenantId")]
As an alternative, allow an equivalent attribute to be declared on the entity property that is the federation distribution key (e.g. the TenantId property).4 votes -
Allow adding fluent code to each entity, to minimize the mess in the context
There should be a way (perhaps by implementing an interface), to add fluent code separately to each entity instead of adding it all in the OnModelCreating method.
The OnModelCreating base method should call all the entities that implement that interface and call OnModelCreating(context) of it.
In this way the bunch of fluent code in the main context, especially if it's a large one, would tidy up in the individual entities.
Of course, this is already simply doable, but I think this should go out the box.4 votes -
Improve conditionals on Table-per-Hierarchy
It never works when your conditionals are based on a int column so where Type=1 etc. Only seems to work for when some column Is Null. It complains about mapping when you try and do this. Seems impossible to work around
4 votes -
Entity Framework support for Windows Store apps
System.Data.dll -- which is fundamental to EF -- is not available inside Windows Store Apps. Thus development of Windows Store apps is two steps back of where WPF and Silverlight development have been.
4 votes -
Make it easier to change or wrap a data provider.
As of now, I need to parse SSDL by myself.
4 votes -
Cascade Delete and Update Attribute
It would be great to have attributes to indicate whether to cascade delete and updates rather than having to use the fluent api.
4 votes -
Public access to metadata mapping to allow building custom SQL queries
Provide an access to the code-first metadata mapping.
The mapping is already described. Why not to provide a public access to a table name, schema, class property to table column mapping.
It will allow to build advanced SQL queries using Database.SqlQuery when performance is is needed. For example - bulk inserts in one query. Or other queries that don't require object state tracking. Currently you need to hard code schema, table and column names in a string, why not provide a way to build a query using defined mapping metadata?4 votes -
Support for Linked SQL Servers
Add support for Linked servers.
4 votes -
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 -
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 – destructiveDatabase 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 -
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 -
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 -
Enable Migrations for EF Designer and EDMX files
For generating database from Model, how can have alter schema from previous schema when developing Model.
4 votes
- Don't see your idea?