public async Task WhenAsync(MergePatchRejectionReasonDto c) { var idObj = (c as IMergePatchRejectionReason).RejectionReasonId; var uriParameters = new RejectionReasonUriParameters(); uriParameters.Id = idObj; var req = new RejectionReasonPatchRequest(uriParameters, (MergePatchRejectionReasonDto)c); var resp = await _ramlClient.RejectionReason.Patch(req); RejectionReasonProxyUtils.ThrowOnHttpResponseError(resp); }
public async Task <IRejectionReasonState> GetHistoryStateAsync(string rejectionReasonId, long version) { var idObj = rejectionReasonId; var uriParameters = new RejectionReasonHistoryStateUriParameters(); uriParameters.Id = idObj; uriParameters.Version = version.ToString(); var req = new RejectionReasonHistoryStateGetRequest(uriParameters); var resp = await _ramlClient.RejectionReasonHistoryState.Get(req); RejectionReasonProxyUtils.ThrowOnHttpResponseError(resp); return((resp.Content == null) ? null : resp.Content.ToRejectionReasonState()); }
public async Task <IRejectionReasonEvent> GetStateEventAsync(string rejectionReasonId, long version) { var idObj = rejectionReasonId; var uriParameters = new RejectionReasonStateEventUriParameters(); uriParameters.Id = idObj; uriParameters.Version = version.ToString(); var req = new RejectionReasonStateEventGetRequest(uriParameters); var resp = await _ramlClient.RejectionReasonStateEvent.Get(req); RejectionReasonProxyUtils.ThrowOnHttpResponseError(resp); return(resp.Content); }
public async Task <IRejectionReasonState> GetAsync(string rejectionReasonId) { IRejectionReasonState state = null; var idObj = rejectionReasonId; var uriParameters = new RejectionReasonUriParameters(); uriParameters.Id = idObj; var req = new RejectionReasonGetRequest(uriParameters); var resp = await _ramlClient.RejectionReason.Get(req); RejectionReasonProxyUtils.ThrowOnHttpResponseError(resp); state = (resp.Content == null) ? null : resp.Content.ToRejectionReasonState(); return(state); }
public async Task <IEnumerable <IRejectionReasonState> > GetAsync(ICriterion filter, IList <string> orders = null, int firstResult = 0, int maxResults = int.MaxValue, IList <string> fields = null) { IEnumerable <IRejectionReasonState> states = null; var q = new RejectionReasonsGetQuery(); q.FirstResult = firstResult; q.MaxResults = maxResults; q.Sort = RejectionReasonProxyUtils.GetOrdersQueryValueString(orders); q.Fields = RejectionReasonProxyUtils.GetReturnedFieldsQueryValueString(fields, QueryFieldValueSeparator); q.Filter = RejectionReasonProxyUtils.GetFilterQueryValueString(filter); var req = new RejectionReasonsGetRequest(); req.Query = q; var resp = await _ramlClient.RejectionReasons.Get(req); RejectionReasonProxyUtils.ThrowOnHttpResponseError(resp); states = (resp.Content == null) ? null : resp.Content.Select(e => e.ToRejectionReasonState()); return(states); }
public async Task WhenAsync(DeleteRejectionReasonDto c) { var idObj = (c as IDeleteRejectionReason).RejectionReasonId; var uriParameters = new RejectionReasonUriParameters(); uriParameters.Id = idObj; var q = new RejectionReasonDeleteQuery(); q.CommandId = c.CommandId; q.RequesterId = c.RequesterId; q.Version = Convert.ToString(c.Version); var req = new RejectionReasonDeleteRequest(uriParameters); req.Query = q; var resp = await _ramlClient.RejectionReason.Delete(req); RejectionReasonProxyUtils.ThrowOnHttpResponseError(resp); }
public async virtual Task <long> GetCountAsync(ICriterion filter) { var q = new RejectionReasonsCountGetQuery(); q.Filter = RejectionReasonProxyUtils.GetFilterQueryValueString(filter); var req = new RejectionReasonsCountGetRequest(); req.Query = q; var resp = await _ramlClient.RejectionReasonsCount.Get(req); RejectionReasonProxyUtils.ThrowOnHttpResponseError(resp); string str = await resp.RawContent.ReadAsStringAsync(); if (str.StartsWith("\"")) { str = str.Substring(1); } if (str.EndsWith("\"")) { str = str.Substring(0, str.Length - 1); } return(long.Parse(str)); }