Beispiel #1
0
        public async Task WhenAsync(MergePatchDamageHandlingMethodDto c)
        {
            var idObj         = (c as IMergePatchDamageHandlingMethod).DamageHandlingMethodId;
            var uriParameters = new DamageHandlingMethodUriParameters();

            uriParameters.Id = idObj;

            var req  = new DamageHandlingMethodPatchRequest(uriParameters, (MergePatchDamageHandlingMethodDto)c);
            var resp = await _ramlClient.DamageHandlingMethod.Patch(req);

            DamageHandlingMethodProxyUtils.ThrowOnHttpResponseError(resp);
        }
Beispiel #2
0
        public async Task <IDamageHandlingMethodState> GetHistoryStateAsync(string damageHandlingMethodId, long version)
        {
            var idObj         = damageHandlingMethodId;
            var uriParameters = new DamageHandlingMethodHistoryStateUriParameters();

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

            var req  = new DamageHandlingMethodHistoryStateGetRequest(uriParameters);
            var resp = await _ramlClient.DamageHandlingMethodHistoryState.Get(req);

            DamageHandlingMethodProxyUtils.ThrowOnHttpResponseError(resp);
            return((resp.Content == null) ? null : resp.Content.ToDamageHandlingMethodState());
        }
Beispiel #3
0
        public async Task <IDamageHandlingMethodEvent> GetStateEventAsync(string damageHandlingMethodId, long version)
        {
            var idObj         = damageHandlingMethodId;
            var uriParameters = new DamageHandlingMethodStateEventUriParameters();

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

            var req  = new DamageHandlingMethodStateEventGetRequest(uriParameters);
            var resp = await _ramlClient.DamageHandlingMethodStateEvent.Get(req);

            DamageHandlingMethodProxyUtils.ThrowOnHttpResponseError(resp);
            return(resp.Content);
        }
Beispiel #4
0
        public async Task <IDamageHandlingMethodState> GetAsync(string damageHandlingMethodId)
        {
            IDamageHandlingMethodState state = null;
            var idObj         = damageHandlingMethodId;
            var uriParameters = new DamageHandlingMethodUriParameters();

            uriParameters.Id = idObj;

            var req = new DamageHandlingMethodGetRequest(uriParameters);

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

            DamageHandlingMethodProxyUtils.ThrowOnHttpResponseError(resp);
            state = (resp.Content == null) ? null : resp.Content.ToDamageHandlingMethodState();
            return(state);
        }
Beispiel #5
0
        public async Task <IEnumerable <IDamageHandlingMethodState> > GetAsync(ICriterion filter, IList <string> orders = null, int firstResult = 0, int maxResults = int.MaxValue, IList <string> fields = null)
        {
            IEnumerable <IDamageHandlingMethodState> states = null;
            var q = new DamageHandlingMethodsGetQuery();

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

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

            DamageHandlingMethodProxyUtils.ThrowOnHttpResponseError(resp);
            states = (resp.Content == null) ? null : resp.Content.Select(e => e.ToDamageHandlingMethodState());
            return(states);
        }
Beispiel #6
0
        public async Task WhenAsync(DeleteDamageHandlingMethodDto c)
        {
            var idObj         = (c as IDeleteDamageHandlingMethod).DamageHandlingMethodId;
            var uriParameters = new DamageHandlingMethodUriParameters();

            uriParameters.Id = idObj;

            var q = new DamageHandlingMethodDeleteQuery();

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

            var req = new DamageHandlingMethodDeleteRequest(uriParameters);

            req.Query = q;

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

            DamageHandlingMethodProxyUtils.ThrowOnHttpResponseError(resp);
        }
Beispiel #7
0
        public async virtual Task <long> GetCountAsync(ICriterion filter)
        {
            var q = new DamageHandlingMethodsCountGetQuery();

            q.Filter = DamageHandlingMethodProxyUtils.GetFilterQueryValueString(filter);
            var req = new DamageHandlingMethodsCountGetRequest();

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

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