init efcore
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user