public void Put(string id, [FromBody] CreateAttributeValueMvoDto value)
 {
     try {
         AttributeValueMvosControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
         _attributeValueMvoApplicationService.When(value as ICreateAttributeValueMvo);
     } catch (Exception ex) { var response = AttributeValueMvosControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
        public async Task WhenAsync(CreateAttributeValueMvoDto c)
        {
            var idObj         = AttributeValueMvoProxyUtils.ToIdString((c as ICreateAttributeValueMvo).AttributeValueId);
            var uriParameters = new AttributeValueMvoUriParameters();

            uriParameters.Id = idObj;

            var req = new AttributeValueMvoPutRequest(uriParameters, (CreateAttributeValueMvoDto)c);

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

            AttributeValueMvoProxyUtils.ThrowOnHttpResponseError(resp);
        }
Exemplo n.º 3
0
        public HttpResponseMessage Post([FromBody] CreateAttributeValueMvoDto value)
        {
            try {
                if (value.AttributeValueId == default(AttributeValueId))
                {
                    throw DomainError.Named("nullId", "Aggregate Id in cmd is null, aggregate name: {0}.", "AttributeValueMvo");
                }
                _attributeValueMvoApplicationService.When(value as ICreateAttributeValueMvo);
                var idObj = value.AttributeValueId;

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