public void Patch(string id, [FromBody] MergePatchPicklistDto value) { try { PicklistsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _picklistApplicationService.When(value as IMergePatchPicklist); } catch (Exception ex) { var response = PicklistsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public void Delete(string id, string commandId, string version, string requesterId = default(string)) { try { var value = new DeletePicklistDto(); value.CommandId = commandId; value.RequesterId = requesterId; value.Version = (long)Convert.ChangeType(version, typeof(long)); PicklistsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _picklistApplicationService.When(value as IDeletePicklist); } catch (Exception ex) { var response = PicklistsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public void Put(string id, [FromBody] CreateOrMergePatchOrDeletePicklistDto value) { try { // /////////////////////////////// if (value.Version != default(long)) { value.CommandType = CommandType.MergePatch; PicklistsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _picklistApplicationService.When(value as IMergePatchPicklist); return; } // /////////////////////////////// PicklistsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _picklistApplicationService.When(value as ICreatePicklist); } catch (Exception ex) { var response = PicklistsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }