VZ
Size: a a a
VZ
V
Ну что же, хорошо хоть не для .NET Framework 1.1
JS
JS
VZ
JS
public class BookAuthorEntity
{
public Guid BookId { get; set; }
public Guid AuthorId { get; set; }
public BookEntity Book { get; set; }
public AuthorEntity Author { get; set; }
}
public class BookAuthorConfiguration : IEntityTypeConfiguration<BookAuthorEntity>
{
public void Configure(EntityTypeBuilder<BookAuthorEntity> builder) {
builder.HasKey(x => new {x.BookId, x.AuthorId});
builder
.HasOne(x => x.Author)
.WithMany(x => x.Books)
.HasForeignKey(x => x.AuthorId)
.OnDelete(DeleteBehavior.NoAction);
builder
.HasOne(x => x.Book)
.WithMany(x => x.Authors)
.HasForeignKey(x => x.BookId)
.OnDelete(DeleteBehavior.NoAction);
}
}
JS
JS
VZ
G
VZ
G
VZ
G
JS
JS
VZ
VZ
JS
А