20 lines
588 B
C#
20 lines
588 B
C#
using BlueLaminate.EFCore.Entities;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
namespace BlueLaminate.EFCore.Configurations;
|
|
|
|
public class TradeItemConfiguration : IEntityTypeConfiguration<TradeItem>
|
|
{
|
|
public void Configure(EntityTypeBuilder<TradeItem> entity)
|
|
{
|
|
entity.HasOne(e => e.Trade)
|
|
.WithMany(t => t.TradeItems)
|
|
.HasForeignKey(e => e.TradeId);
|
|
|
|
entity.HasOne(e => e.InventoryItem)
|
|
.WithMany(i => i.TradeItems)
|
|
.HasForeignKey(e => e.InventoryItemId);
|
|
}
|
|
}
|