public TrackingVM Add(TrackingVM entity) { try { var traceability = _mapper.Map <Tracking>(entity); if (entity.ClientID != null && entity.ClientID != Guid.Empty) { traceability.AddClient(entity.ClientID); } //if (!boxType.ComponentValidator.Validate(boxType, new BoxTypeValidator())) //{ // throw new CustomException(string.Join(", ", boxType.ComponentValidator.ValidationResult.Errors.Select(x => x.ErrorMessage))); //} _unitOfWork.Repository <Tracking>().Add(traceability); _unitOfWork.CommitSync(); return(entity); } catch (CustomException exc) { throw exc; } catch (Exception ex) { throw CustomException.Create <TrackingApplicationService>("Unexpected error fetching add trace", nameof(this.Add), ex); } }
public IActionResult Create(TrackingVM traceabilityVM) { try { _boxTrackingApplicationService.Add(traceabilityVM); return(RedirectToAction("Index", "Box")); } catch (CustomException exc) { throw exc; } catch (Exception ex) { throw ex; } }
public Task <TrackingVM> AddAsync(TrackingVM entity) { throw new NotImplementedException(); }
public Task <TrackingVM> UpdateAsync(TrackingVM updated) { throw new NotImplementedException(); }
public TrackingVM Update(TrackingVM updated) { throw new NotImplementedException(); }