This commit is contained in:
tongfei
2023-11-06 17:53:18 +08:00
parent 7b4f6f82a1
commit 4ec6b69714
5 changed files with 37 additions and 27 deletions

View File

@@ -131,8 +131,8 @@ namespace WMS.Web.Repositories
.Include(s => s.Details)
.FirstOrDefaultAsync(f => f.Id == id);
//return entity.Clone();
return entity;
return entity.Clone();
//return entity;
}
/// <summary>
@@ -340,14 +340,17 @@ namespace WMS.Web.Repositories
try
{
var model = await _context.InStockTask
.AsNoTracking()
.Include(s=>s.Boxs)
.Include(s => s.Details)
.FirstOrDefaultAsync(f => f.Id == entity.Id);
if (model == null)
return null;
_mapper.Map(entity, model);
var result= await _context.SaveChangesAsync();
//子集单独映射
_mapper.ToMapList(entity.Boxs, model.Boxs);
//子集单独映射
_mapper.ToMapList(entity.Details, model.Details);
var result = await _context.SaveChangesAsync();
if (_transaction != null)
_transaction.Commit();
return model;