Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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");
- }
- }
Add Comment
Please, Sign In to add comment