public void Patch(string id, [FromBody] MergePatchGoodIdentificationTypeDto value) { try { GoodIdentificationTypesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _goodIdentificationTypeApplicationService.When(value as IMergePatchGoodIdentificationType); } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public void Delete(string id, string commandId, string version, string requesterId = default(string)) { try { var value = new DeleteGoodIdentificationTypeDto(); value.CommandId = commandId; value.RequesterId = requesterId; value.Version = (long)Convert.ChangeType(version, typeof(long)); GoodIdentificationTypesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _goodIdentificationTypeApplicationService.When(value as IDeleteGoodIdentificationType); } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public void Put(string id, [FromBody] CreateOrMergePatchOrDeleteGoodIdentificationTypeDto value) { try { // /////////////////////////////// if (value.Version != default(long)) { value.CommandType = CommandType.MergePatch; GoodIdentificationTypesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _goodIdentificationTypeApplicationService.When(value as IMergePatchGoodIdentificationType); return; } // /////////////////////////////// GoodIdentificationTypesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _goodIdentificationTypeApplicationService.When(value as ICreateGoodIdentificationType); } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }