mirror of
https://github.com/rmcrackan/Libation.git
synced 2026-01-18 18:58:16 -05:00
18 lines
502 B
C#
18 lines
502 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
namespace DataLayer.Configurations
|
|
{
|
|
internal class LibraryBookConfig : IEntityTypeConfiguration<LibraryBook>
|
|
{
|
|
public void Configure(EntityTypeBuilder<LibraryBook> entity)
|
|
{
|
|
entity.HasKey(b => b.BookId);
|
|
|
|
entity
|
|
.HasOne(le => le.Book)
|
|
.WithOne()
|
|
.HasForeignKey<LibraryBook>(le => le.BookId);
|
|
}
|
|
}
|
|
} |