コード例 #1
0
        public async Task WhenAsync(MergePatchGoodIdentificationMvoDto c)
        {
            var idObj         = GoodIdentificationMvoProxyUtils.ToIdString((c as IMergePatchGoodIdentificationMvo).ProductGoodIdentificationId);
            var uriParameters = new GoodIdentificationMvoUriParameters();

            uriParameters.Id = idObj;

            var req  = new GoodIdentificationMvoPatchRequest(uriParameters, (MergePatchGoodIdentificationMvoDto)c);
            var resp = await _ramlClient.GoodIdentificationMvo.Patch(req);

            GoodIdentificationMvoProxyUtils.ThrowOnHttpResponseError(resp);
        }
コード例 #2
0
        public async Task <IGoodIdentificationMvoState> GetHistoryStateAsync(ProductGoodIdentificationId productGoodIdentificationId, long version)
        {
            var idObj         = GoodIdentificationMvoProxyUtils.ToIdString(productGoodIdentificationId);
            var uriParameters = new GoodIdentificationMvoHistoryStateUriParameters();

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

            var req  = new GoodIdentificationMvoHistoryStateGetRequest(uriParameters);
            var resp = await _ramlClient.GoodIdentificationMvoHistoryState.Get(req);

            GoodIdentificationMvoProxyUtils.ThrowOnHttpResponseError(resp);
            return((resp.Content == null) ? null : resp.Content.ToGoodIdentificationMvoState());
        }
コード例 #3
0
        public async Task <IGoodIdentificationMvoEvent> GetStateEventAsync(ProductGoodIdentificationId productGoodIdentificationId, long version)
        {
            var idObj         = GoodIdentificationMvoProxyUtils.ToIdString(productGoodIdentificationId);
            var uriParameters = new GoodIdentificationMvoStateEventUriParameters();

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

            var req  = new GoodIdentificationMvoStateEventGetRequest(uriParameters);
            var resp = await _ramlClient.GoodIdentificationMvoStateEvent.Get(req);

            GoodIdentificationMvoProxyUtils.ThrowOnHttpResponseError(resp);
            return(resp.Content);
        }
コード例 #4
0
        public async Task <IGoodIdentificationMvoState> GetAsync(ProductGoodIdentificationId productGoodIdentificationId)
        {
            IGoodIdentificationMvoState state = null;
            var idObj         = GoodIdentificationMvoProxyUtils.ToIdString(productGoodIdentificationId);
            var uriParameters = new GoodIdentificationMvoUriParameters();

            uriParameters.Id = idObj;

            var req = new GoodIdentificationMvoGetRequest(uriParameters);

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

            GoodIdentificationMvoProxyUtils.ThrowOnHttpResponseError(resp);
            state = (resp.Content == null) ? null : resp.Content.ToGoodIdentificationMvoState();
            return(state);
        }
コード例 #5
0
        public async Task <IEnumerable <IGoodIdentificationMvoState> > GetAsync(ICriterion filter, IList <string> orders = null, int firstResult = 0, int maxResults = int.MaxValue, IList <string> fields = null)
        {
            IEnumerable <IGoodIdentificationMvoState> states = null;
            var q = new GoodIdentificationMvosGetQuery();

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

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

            GoodIdentificationMvoProxyUtils.ThrowOnHttpResponseError(resp);
            states = (resp.Content == null) ? null : resp.Content.Select(e => e.ToGoodIdentificationMvoState());
            return(states);
        }
コード例 #6
0
        public async Task WhenAsync(DeleteGoodIdentificationMvoDto c)
        {
            var idObj         = GoodIdentificationMvoProxyUtils.ToIdString((c as IDeleteGoodIdentificationMvo).ProductGoodIdentificationId);
            var uriParameters = new GoodIdentificationMvoUriParameters();

            uriParameters.Id = idObj;

            var q = new GoodIdentificationMvoDeleteQuery();

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

            var req = new GoodIdentificationMvoDeleteRequest(uriParameters);

            req.Query = q;

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

            GoodIdentificationMvoProxyUtils.ThrowOnHttpResponseError(resp);
        }
コード例 #7
0
        public async virtual Task <long> GetCountAsync(ICriterion filter)
        {
            var q = new GoodIdentificationMvosCountGetQuery();

            q.Filter = GoodIdentificationMvoProxyUtils.GetFilterQueryValueString(filter);
            var req = new GoodIdentificationMvosCountGetRequest();

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

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