Skip to content

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

Closed as duplicate

Description

@eduherminio

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

Activity

  1. changed the title [-]Allow creating Composite Keys using attributes[/-] [+]Create additional .NET attributes (like data annotations) for EF Core configuration[/+] on Oct 18, 2017
  2. ajcvickers commented on Oct 18, 2017

    @ajcvickers
    Contributor

    @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.

  3. added this to the Backlog milestone on Oct 18, 2017
  4. ajcvickers commented on Feb 21, 2018

    @ajcvickers
    Contributor

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

  5. SoaresMG commented on Jun 3, 2018

    @SoaresMG

    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!

  6. ajcvickers commented on Jun 5, 2018

    @ajcvickers
    Contributor

    @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.

  7. SoaresMG commented on Jun 5, 2018

    @SoaresMG

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

  8. ajcvickers commented on Aug 13, 2018

    @ajcvickers
    Contributor

    Consider ToView. See dotnet/EntityFramework.Docs#913

  9. ajcvickers commented on Jan 30, 2019

    @ajcvickers
    Contributor

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

  10. added
    good first issue
    on Sep 2, 2019
  11. ajcvickers commented on Sep 4, 2019

    @ajcvickers
    Contributor

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

  12. added and removed
    good first issue
    on Sep 4, 2019
  13. removed this from the Backlog milestone on Sep 4, 2019
  14. added theissue type on Jun 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions