Пример #1
0
        public HttpResponseMessage Post([FromBody] CreateRoleTypeDto value)
        {
            try {
                if (value.RoleTypeId == default(string))
                {
                    throw DomainError.Named("nullId", "Aggregate Id in cmd is null, aggregate name: {0}.", "RoleType");
                }
                _roleTypeApplicationService.When(value as ICreateRoleType);
                var idObj = value.RoleTypeId;

                return(Request.CreateResponse <string>(HttpStatusCode.Created, idObj));
            } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
        }