Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create additional .NET attributes (like data annotations) for EF Core configuration #10111

Closed
eduherminio opened this issue Oct 18, 2017 · 8 comments

Comments

@eduherminio
Copy link
Member

I guess there some good reason not to do it, but here it is the suggestion just in case.

@ajcvickers ajcvickers changed the title Allow creating Composite Keys using attributes Create additional .NET attributes (like data annotations) for EF Core configuration Oct 18, 2017
@ajcvickers
Copy link
Member

@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
Copy link
Member

See also #11003 for the specific case of configuring a composite key.

@SoaresMG
Copy link

SoaresMG commented 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
Copy link
Member

@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
Copy link

SoaresMG commented Jun 5, 2018

@ajcvickers I see... I was just trying my luck. 👍

@ajcvickers
Copy link
Member

Consider ToView. See dotnet/EntityFramework.Docs#913

@ajcvickers
Copy link
Member

@divega to split out into different issues for each attribute.

@ajcvickers ajcvickers added the good first issue This issue should be relatively straightforward to fix. label Sep 2, 2019
@ajcvickers
Copy link
Member

Closing as a duplicate of #10864 since that issue has more votes.

@ajcvickers ajcvickers added closed-duplicate and removed consider-for-current-release good first issue This issue should be relatively straightforward to fix. labels Sep 4, 2019
@ajcvickers ajcvickers removed this from the Backlog milestone Sep 4, 2019
@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants