public async Task WhenAsync(MergePatchPicklistRoleMvoDto c)
        {
            var idObj         = PicklistRoleMvoProxyUtils.ToIdString((c as IMergePatchPicklistRoleMvo).PicklistRoleId);
            var uriParameters = new PicklistRoleMvoUriParameters();

            uriParameters.Id = idObj;

            var req  = new PicklistRoleMvoPatchRequest(uriParameters, (MergePatchPicklistRoleMvoDto)c);
            var resp = await _ramlClient.PicklistRoleMvo.Patch(req);

            PicklistRoleMvoProxyUtils.ThrowOnHttpResponseError(resp);
        }
        public async Task <IPicklistRoleMvoState> GetHistoryStateAsync(PicklistRoleId picklistRoleId, long version)
        {
            var idObj         = PicklistRoleMvoProxyUtils.ToIdString(picklistRoleId);
            var uriParameters = new PicklistRoleMvoHistoryStateUriParameters();

            uriParameters.Id      = idObj;
            uriParameters.Version = version.ToString();

            var req  = new PicklistRoleMvoHistoryStateGetRequest(uriParameters);
            var resp = await _ramlClient.PicklistRoleMvoHistoryState.Get(req);

            PicklistRoleMvoProxyUtils.ThrowOnHttpResponseError(resp);
            return((resp.Content == null) ? null : resp.Content.ToPicklistRoleMvoState());
        }
        public async Task <IPicklistRoleMvoEvent> GetStateEventAsync(PicklistRoleId picklistRoleId, long version)
        {
            var idObj         = PicklistRoleMvoProxyUtils.ToIdString(picklistRoleId);
            var uriParameters = new PicklistRoleMvoStateEventUriParameters();

            uriParameters.Id      = idObj;
            uriParameters.Version = version.ToString();

            var req  = new PicklistRoleMvoStateEventGetRequest(uriParameters);
            var resp = await _ramlClient.PicklistRoleMvoStateEvent.Get(req);

            PicklistRoleMvoProxyUtils.ThrowOnHttpResponseError(resp);
            return(resp.Content);
        }
        public async Task <IPicklistRoleMvoState> GetAsync(PicklistRoleId picklistRoleId)
        {
            IPicklistRoleMvoState state = null;
            var idObj         = PicklistRoleMvoProxyUtils.ToIdString(picklistRoleId);
            var uriParameters = new PicklistRoleMvoUriParameters();

            uriParameters.Id = idObj;

            var req = new PicklistRoleMvoGetRequest(uriParameters);

            var resp = await _ramlClient.PicklistRoleMvo.Get(req);

            PicklistRoleMvoProxyUtils.ThrowOnHttpResponseError(resp);
            state = (resp.Content == null) ? null : resp.Content.ToPicklistRoleMvoState();
            return(state);
        }
        public async Task <IEnumerable <IPicklistRoleMvoState> > GetAsync(ICriterion filter, IList <string> orders = null, int firstResult = 0, int maxResults = int.MaxValue, IList <string> fields = null)
        {
            IEnumerable <IPicklistRoleMvoState> states = null;
            var q = new PicklistRoleMvosGetQuery();

            q.FirstResult = firstResult;
            q.MaxResults  = maxResults;
            q.Sort        = PicklistRoleMvoProxyUtils.GetOrdersQueryValueString(orders);
            q.Fields      = PicklistRoleMvoProxyUtils.GetReturnedFieldsQueryValueString(fields, QueryFieldValueSeparator);
            q.Filter      = PicklistRoleMvoProxyUtils.GetFilterQueryValueString(filter);
            var req = new PicklistRoleMvosGetRequest();

            req.Query = q;
            var resp = await _ramlClient.PicklistRoleMvos.Get(req);

            PicklistRoleMvoProxyUtils.ThrowOnHttpResponseError(resp);
            states = (resp.Content == null) ? null : resp.Content.Select(e => e.ToPicklistRoleMvoState());
            return(states);
        }
        public async Task WhenAsync(DeletePicklistRoleMvoDto c)
        {
            var idObj         = PicklistRoleMvoProxyUtils.ToIdString((c as IDeletePicklistRoleMvo).PicklistRoleId);
            var uriParameters = new PicklistRoleMvoUriParameters();

            uriParameters.Id = idObj;

            var q = new PicklistRoleMvoDeleteQuery();

            q.CommandId   = c.CommandId;
            q.RequesterId = c.RequesterId;
            q.Version     = Convert.ToString(c.PicklistVersion);

            var req = new PicklistRoleMvoDeleteRequest(uriParameters);

            req.Query = q;

            var resp = await _ramlClient.PicklistRoleMvo.Delete(req);

            PicklistRoleMvoProxyUtils.ThrowOnHttpResponseError(resp);
        }
        public async virtual Task <long> GetCountAsync(ICriterion filter)
        {
            var q = new PicklistRoleMvosCountGetQuery();

            q.Filter = PicklistRoleMvoProxyUtils.GetFilterQueryValueString(filter);
            var req = new PicklistRoleMvosCountGetRequest();

            req.Query = q;
            var resp = await _ramlClient.PicklistRoleMvosCount.Get(req);

            PicklistRoleMvoProxyUtils.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));
        }