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

Model Definition: Bulk configuration using Fluent API #9117

Open
Tracked by #22952
AndriySvyryd opened this issue Jul 8, 2017 · 0 comments
Open
Tracked by #22952

Model Definition: Bulk configuration using Fluent API #9117

AndriySvyryd opened this issue Jul 8, 2017 · 0 comments

Comments

@AndriySvyryd
Copy link
Member

AndriySvyryd commented Jul 8, 2017

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
    foreach (var entityType in modelBuilder.Entities())
    {
        entityType.HasKey("Id");
    }
    foreach (var ownedEntityType in modelBuilder.OwnedEntities())
    {
        ownedEntityType.HasForeignKey("Id");
    }
}

Related to #6787 and #15258

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

2 participants