init efcore

This commit is contained in:
bob
2026-05-29 12:21:42 -05:00
commit 3d3a5c2a5e
28 changed files with 2071 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
using BlueLaminate.EFCore.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace BlueLaminate.EFCore.Configurations;
public class InventoryItemConfiguration : IEntityTypeConfiguration<InventoryItem>
{
public void Configure(EntityTypeBuilder<InventoryItem> entity)
{
entity.HasIndex(e => e.AssetId);
entity.HasOne(e => e.User)
.WithMany(u => u.InventoryItems)
.HasForeignKey(e => e.UserId);
entity.HasOne(e => e.SkinInstance)
.WithMany(i => i.InventoryItems)
.HasForeignKey(e => e.SkinInstanceId);
}
}