public async Task WhenAsync(MergePatchAttributeSetDto c)
        {
            var idObj         = (c as IMergePatchAttributeSet).AttributeSetId;
            var uriParameters = new AttributeSetUriParameters();

            uriParameters.Id = idObj;

            var req  = new AttributeSetPatchRequest(uriParameters, (MergePatchAttributeSetDto)c);
            var resp = await _ramlClient.AttributeSet.Patch(req);

            AttributeSetProxyUtils.ThrowOnHttpResponseError(resp);
        }
Esempio n. 2
0
        public async virtual Task <long> GetCountAsync(ICriterion filter)
        {
            var q = new AttributeSetsCountGetQuery();

            q.Filter = AttributeSetProxyUtils.GetFilterQueryValueString(filter);
            var req = new AttributeSetsCountGetRequest();

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

            AttributeSetProxyUtils.ThrowOnHttpResponseError(resp);
            return(long.Parse(await resp.RawContent.ReadAsStringAsync()));
        }
        public async virtual Task <IAttributeUseState> GetAttributeUseAsync(string attributeSetId, string attributeId)
        {
            var uriParameters = new AttributeUseUriParameters();

            uriParameters.AttributeSetId = attributeSetId;
            uriParameters.AttributeId    = attributeId;

            var req  = new AttributeUseGetRequest(uriParameters);
            var resp = await _ramlClient.AttributeUse.Get(req);

            AttributeSetProxyUtils.ThrowOnHttpResponseError(resp);
            return((resp.Content == null) ? null : resp.Content.ToAttributeUseState());
        }
        public async Task <IAttributeSetState> GetHistoryStateAsync(string attributeSetId, long version)
        {
            var idObj         = attributeSetId;
            var uriParameters = new AttributeSetHistoryStateUriParameters();

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

            var req  = new AttributeSetHistoryStateGetRequest(uriParameters);
            var resp = await _ramlClient.AttributeSetHistoryState.Get(req);

            AttributeSetProxyUtils.ThrowOnHttpResponseError(resp);
            return((resp.Content == null) ? null : resp.Content.ToAttributeSetState());
        }
        public async Task <IAttributeSetStateEvent> GetStateEventAsync(string attributeSetId, long version)
        {
            var idObj         = attributeSetId;
            var uriParameters = new AttributeSetStateEventUriParameters();

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

            var req  = new AttributeSetStateEventGetRequest(uriParameters);
            var resp = await _ramlClient.AttributeSetStateEvent.Get(req);

            AttributeSetProxyUtils.ThrowOnHttpResponseError(resp);
            return(resp.Content);
        }
        public async Task <IAttributeSetState> GetAsync(string attributeSetId)
        {
            IAttributeSetState state = null;
            var idObj         = attributeSetId;
            var uriParameters = new AttributeSetUriParameters();

            uriParameters.Id = idObj;

            var req = new AttributeSetGetRequest(uriParameters);

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

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

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

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

            AttributeSetProxyUtils.ThrowOnHttpResponseError(resp);
            states = (resp.Content == null) ? null : resp.Content.Select(e => e.ToAttributeSetState());
            return(states);
        }
        public async Task WhenAsync(DeleteAttributeSetDto c)
        {
            var idObj         = (c as IDeleteAttributeSet).AttributeSetId;
            var uriParameters = new AttributeSetUriParameters();

            uriParameters.Id = idObj;

            var q = new AttributeSetDeleteQuery();

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

            var req = new AttributeSetDeleteRequest(uriParameters);

            req.Query = q;

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

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

            q.Filter = AttributeSetProxyUtils.GetFilterQueryValueString(filter);
            var req = new AttributeSetsCountGetRequest();

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

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