Example #1
0
 public void Put(string id, [FromBody] CreateAttributeUseMvoDto value)
 {
     try {
         AttributeUseMvosControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
         _attributeUseMvoApplicationService.When(value as ICreateAttributeUseMvo);
     } catch (Exception ex) { var response = AttributeUseMvosControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
        public async Task WhenAsync(CreateAttributeUseMvoDto c)
        {
            var idObj         = AttributeUseMvoProxyUtils.ToIdString((c as ICreateAttributeUseMvo).AttributeSetAttributeUseId);
            var uriParameters = new AttributeUseMvoUriParameters();

            uriParameters.Id = idObj;

            var req = new AttributeUseMvoPutRequest(uriParameters, (CreateAttributeUseMvoDto)c);

            var resp = await _ramlClient.AttributeUseMvo.Put(req);

            AttributeUseMvoProxyUtils.ThrowOnHttpResponseError(resp);
        }
Example #3
0
        public HttpResponseMessage Post([FromBody] CreateAttributeUseMvoDto value)
        {
            try {
                if (value.AttributeSetAttributeUseId == default(AttributeSetAttributeUseId))
                {
                    throw DomainError.Named("nullId", "Aggregate Id in cmd is null, aggregate name: {0}.", "AttributeUseMvo");
                }
                _attributeUseMvoApplicationService.When(value as ICreateAttributeUseMvo);
                var idObj = value.AttributeSetAttributeUseId;

                return(Request.CreateResponse <AttributeSetAttributeUseId>(HttpStatusCode.Created, idObj));
            } catch (Exception ex) { var response = AttributeUseMvosControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
        }
 public void When(CreateAttributeUseMvoDto c)
 {
     WhenAsync(c).GetAwaiter().GetResult();
 }