Exemplo n.º 1
0
        public HttpResponseMessage Post([FromBody] CreateAttributeSetInstanceExtensionFieldDto value)
        {
            try {
                if (value.Name == default(string))
                {
                    throw DomainError.Named("nullId", "Aggregate Id in cmd is null, aggregate name: {0}.", "AttributeSetInstanceExtensionField");
                }
                _attributeSetInstanceExtensionFieldApplicationService.When(value as ICreateAttributeSetInstanceExtensionField);
                var idObj = value.Name;

                return(Request.CreateResponse <string>(HttpStatusCode.Created, idObj));
            } catch (Exception ex) { var response = AttributeSetInstanceExtensionFieldsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
        }
Exemplo n.º 2
0
        public async Task WhenAsync(CreateAttributeSetInstanceExtensionFieldDto c)
        {
            var idObj         = (c as ICreateAttributeSetInstanceExtensionField).Name;
            var uriParameters = new AttributeSetInstanceExtensionFieldUriParameters();

            uriParameters.Id = idObj;

            var req = new AttributeSetInstanceExtensionFieldPutRequest(uriParameters, (CreateAttributeSetInstanceExtensionFieldDto)c);

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

            AttributeSetInstanceExtensionFieldProxyUtils.ThrowOnHttpResponseError(resp);
        }
Exemplo n.º 3
0
 public void When(CreateAttributeSetInstanceExtensionFieldDto c)
 {
     WhenAsync(c).GetAwaiter().GetResult();
 }