Example #1
0
        public async Task WhenAsync(CreateDocumentTypeDto c)
        {
            var idObj         = (c as ICreateDocumentType).DocumentTypeId;
            var uriParameters = new DocumentTypeUriParameters();

            uriParameters.Id = idObj;

            var req = new DocumentTypePutRequest(uriParameters, (CreateDocumentTypeDto)c);

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

            DocumentTypeProxyUtils.ThrowOnHttpResponseError(resp);
        }
Example #2
0
        public HttpResponseMessage Post([FromBody] CreateDocumentTypeDto value)
        {
            try {
                if (value.DocumentTypeId == default(string))
                {
                    throw DomainError.Named("nullId", "Aggregate Id in cmd is null, aggregate name: {0}.", "DocumentType");
                }
                _documentTypeApplicationService.When(value as ICreateDocumentType);
                var idObj = value.DocumentTypeId;

                return(Request.CreateResponse <string>(HttpStatusCode.Created, idObj));
            } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
        }
Example #3
0
 public void When(CreateDocumentTypeDto c)
 {
     WhenAsync(c).GetAwaiter().GetResult();
 }