You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Create additional .NET attributes (like data annotations) for EF Core configuration #10111
changed the title [-]Allow creating Composite Keys using attributes[/-][+]Create additional .NET attributes (like data annotations) for EF Core configuration[/+]on Oct 18, 2017
@eduherminio The reason is that it used a combination of Key and Column for ordering, but column ordering is not the same thing as key ordering, and so this caused confusion and issues in EF6. Changing existing data annotations is also costly because of their relationship to .NET Core and .NET Framework.
However, we see the value in being able to this and other common configuration using attributes, since the jump to the fluent API can be a big one. Therefore, we will investigate creating a new library/package with additional new EF configuration attributes that can be used alongside data annotations. This would be one of the things that would be implemented there.
I've an application with almost 1000 tables which 100-150 use composite keys.
I didn't use a single LOC for fluent API, purely using Data Annotations.
So... I won't be able to run from fluent API because of "confusion"?
Is this the right approach?
Btw do we have an ETA on that package?
While the package doesn't come out, I will keep doing both.
Configuring Data Annotations and Fluent API at the same time, once the package comes, I will delete the fluent API code.
@SoaresMG This issue is in the Backlog milestone. This means that it is not scheduled to happen for the 2.2 or 3.0 releases. We will re-assess the backlog following the 3.0 release and consider this item at that time. However, keep in mind that there are many other high priority features with which it will be competing for resources.
Activity
[-]Allow creating Composite Keys using attributes[/-][+]Create additional .NET attributes (like data annotations) for EF Core configuration[/+]ajcvickers commentedon Oct 18, 2017
@eduherminio The reason is that it used a combination of Key and Column for ordering, but column ordering is not the same thing as key ordering, and so this caused confusion and issues in EF6. Changing existing data annotations is also costly because of their relationship to .NET Core and .NET Framework.
However, we see the value in being able to this and other common configuration using attributes, since the jump to the fluent API can be a big one. Therefore, we will investigate creating a new library/package with additional new EF configuration attributes that can be used alongside data annotations. This would be one of the things that would be implemented there.
ajcvickers commentedon Feb 21, 2018
See also #11003 for the specific case of configuring a composite key.
SoaresMG commentedon Jun 3, 2018
I've an application with almost 1000 tables which 100-150 use composite keys.
I didn't use a single LOC for fluent API, purely using Data Annotations.
So... I won't be able to run from fluent API because of "confusion"?
Is this the right approach?
Btw do we have an ETA on that package?
While the package doesn't come out, I will keep doing both.
Configuring Data Annotations and Fluent API at the same time, once the package comes, I will delete the fluent API code.
Keep the good job on ef core!
ajcvickers commentedon Jun 5, 2018
@SoaresMG This issue is in the Backlog milestone. This means that it is not scheduled to happen for the 2.2 or 3.0 releases. We will re-assess the backlog following the 3.0 release and consider this item at that time. However, keep in mind that there are many other high priority features with which it will be competing for resources.
SoaresMG commentedon Jun 5, 2018
@ajcvickers I see... I was just trying my luck. 👍
ajcvickers commentedon Aug 13, 2018
Consider ToView. See dotnet/EntityFramework.Docs#913
ajcvickers commentedon Jan 30, 2019
@divega to split out into different issues for each attribute.
ajcvickers commentedon Sep 4, 2019
Closing as a duplicate of #10864 since that issue has more votes.