public Task <ObjectResult> CreateResponse(object result, HttpStatusCode httpStatusCode = HttpStatusCode.OK) { return(Task.FromResult(_domainEvent.IsError() ? StatusCode((int)HttpStatusCode.BadRequest, _domainEvent.GetErrorMessages()) : StatusCode((int)httpStatusCode, result))); }