init efcore
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
using BlueLaminate.EFCore.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace BlueLaminate.EFCore.Configurations;
|
||||
|
||||
public class SkinInstanceConfiguration : IEntityTypeConfiguration<SkinInstance>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<SkinInstance> entity)
|
||||
{
|
||||
entity.Property(e => e.FloatValue).HasColumnType("numeric(10,9)");
|
||||
|
||||
// Primary lookup key for trade fingerprinting.
|
||||
entity.HasIndex(e => e.FloatValue);
|
||||
entity.HasIndex(e => e.PaintSeed);
|
||||
|
||||
entity.HasOne(e => e.Skin)
|
||||
.WithMany(s => s.Instances)
|
||||
.HasForeignKey(e => e.SkinId);
|
||||
|
||||
entity.HasOne(e => e.Condition)
|
||||
.WithMany(c => c.Instances)
|
||||
.HasForeignKey(e => e.ConditionId)
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user