优化接口
This commit is contained in:
@@ -171,7 +171,7 @@ namespace WMS.Web.Repositories
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<InStock> Update(InStock entity, bool isTransaction = true)
|
||||
public async Task<bool> Update(InStock entity, bool isTransaction = true)
|
||||
{
|
||||
IDbContextTransaction _transaction = null;
|
||||
if (isTransaction)
|
||||
@@ -183,7 +183,7 @@ namespace WMS.Web.Repositories
|
||||
.Include(s => s.ErpDetails)
|
||||
.FirstOrDefaultAsync(f => f.Id == entity.Id);
|
||||
if (model == null)
|
||||
return null;
|
||||
return false;
|
||||
_mapper.Map(entity, model);
|
||||
//子集单独映射
|
||||
_mapper.ToMapList(entity.Details, model.Details);
|
||||
@@ -192,13 +192,13 @@ namespace WMS.Web.Repositories
|
||||
await _context.SaveChangesAsync();
|
||||
if (_transaction != null)
|
||||
_transaction.Commit();
|
||||
return model;
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (_transaction != null)
|
||||
_transaction.Rollback();
|
||||
return null;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user