Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public class PostConfig : IEntityTypeConfiguration<Post>
{
public void Configure(EntityTypeBuilder<Post> builder)
{
builder.HasOne(p => p.Blog)
.WithOne(b => b.Posts)
.HasForeignKey(p => p.BlogId)
.HasConstraintName("ForeignKey_Post_Blog");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment