数据库映射
This commit is contained in:
@@ -4,6 +4,7 @@ using Microsoft.Extensions.Logging.Debug;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using WMS.Web.Domain.Entitys;
|
||||
using WMS.Web.Repositories.Configuration.Log;
|
||||
|
||||
namespace WMS.Web.Repositories.Configuration
|
||||
@@ -29,6 +30,79 @@ namespace WMS.Web.Repositories.Configuration
|
||||
protected override void OnModelCreating(ModelBuilder builder)
|
||||
{
|
||||
base.OnModelCreating(builder);
|
||||
}
|
||||
|
||||
//改箱
|
||||
builder.Entity<ChangeBoxRecord>(ent =>
|
||||
{
|
||||
ent.ToTable("t_wms_changebox_record");
|
||||
ent.HasKey(x => x.Id);
|
||||
});
|
||||
//移箱
|
||||
builder.Entity<MoveBoxRecord>(ent =>
|
||||
{
|
||||
ent.ToTable("t_wms_movebox_record");
|
||||
ent.HasKey(x => x.Id);
|
||||
});
|
||||
|
||||
#region 出库单
|
||||
builder.Entity<OutStock>(ent =>
|
||||
{
|
||||
ent.ToTable("t_wms_outstock");
|
||||
ent.HasKey(x => x.Id);
|
||||
|
||||
ent.HasMany(p => p.Details)
|
||||
.WithOne()
|
||||
.HasForeignKey(p => p.OutStockId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
builder.Entity<OutStockDetails>(ent =>
|
||||
{
|
||||
ent.ToTable("t_wms_outstock_details");
|
||||
ent.HasKey(x => x.Id);
|
||||
});
|
||||
#endregion
|
||||
|
||||
#region 出库任务单
|
||||
builder.Entity<OutStockTask>(ent =>
|
||||
{
|
||||
ent.ToTable("t_erp_outstock_task");
|
||||
ent.HasKey(x => x.Id);
|
||||
|
||||
ent.HasMany(p => p.Details)
|
||||
.WithOne()
|
||||
.HasForeignKey(p => p.OutStockTaskId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
builder.Entity<OutStockTaskDetails>(ent =>
|
||||
{
|
||||
ent.ToTable("t_erp_outstock_task_details");
|
||||
ent.HasKey(x => x.Id);
|
||||
});
|
||||
#endregion
|
||||
|
||||
#region 盘点单
|
||||
builder.Entity<TakeStock>(ent =>
|
||||
{
|
||||
ent.ToTable("t_wms_takestock");
|
||||
ent.HasKey(x => x.Id);
|
||||
|
||||
ent.HasMany(p => p.Details)
|
||||
.WithOne()
|
||||
.HasForeignKey(p => p.TakeStockId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
builder.Entity<TakeStockDetails>(ent =>
|
||||
{
|
||||
ent.ToTable("t_wms_takestock_details");
|
||||
ent.HasKey(x => x.Id);
|
||||
});
|
||||
#endregion
|
||||
}
|
||||
|
||||
public DbSet<ChangeBoxRecord> ChangeBoxRecord { get; set; }
|
||||
public DbSet<MoveBoxRecord> MoveBoxRecord { get; set; }
|
||||
public DbSet<OutStock> OutStock { get; set; }
|
||||
public DbSet<OutStockTask> OutStockTask { get; set; }
|
||||
public DbSet<TakeStock> TakeStock { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user