Exemplo n.º 1
0
 public void Patch(string id, [FromBody] MergePatchLotDto value)
 {
     try {
         LotsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
         _lotApplicationService.When(value as IMergePatchLot);
     } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
Exemplo n.º 2
0
 public void Delete(string id, string commandId, string version, string requesterId = default(string))
 {
     try {
         var value = new DeleteLotDto();
         value.CommandId   = commandId;
         value.RequesterId = requesterId;
         value.Version     = (long)Convert.ChangeType(version, typeof(long));
         LotsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
         _lotApplicationService.When(value as IDeleteLot);
     } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
Exemplo n.º 3
0
        public void Put(string id, [FromBody] CreateOrMergePatchOrDeleteLotDto value)
        {
            try {
                // ///////////////////////////////
                if (value.Version != default(long))
                {
                    value.CommandType = CommandType.MergePatch;
                    LotsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
                    _lotApplicationService.When(value as IMergePatchLot);
                    return;
                }
                // ///////////////////////////////

                LotsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
                _lotApplicationService.When(value as ICreateLot);
            } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
        }