public Consignment UpdateConsignment(UpdateConsignment updateConsignment) { if (updateConsignment.AssemblyMmsIds != null) { var assemblyMmses = _assemblyMmsService .GetAssemblyMmsByIds(updateConsignment.AssemblyMmsIds); if (assemblyMmses.Any(a => a.Consignment != null)) { throw new Exception(); } updateConsignment.AssemblyMms = assemblyMmses; } return(_consignmentRepository.UpdateConsignment(updateConsignment)); }
public Consignment UpdateConsignment(UpdateConsignment updateConsignment) { var consignment = _context.Consignments.Where(a => a.Id.Equals(updateConsignment.Id)).SingleOrDefault(); if (consignment is null) { throw new Exception(""); } if (updateConsignment.AssemblyMms != null) { consignment.AssemblyMms = updateConsignment.AssemblyMms; } _context.SaveChanges(); return(consignment); }
public Consignment UpdateConsignment(UpdateConsignment consignment) { return(_consignmentService.UpdateConsignment(consignment)); }