tt
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user