Esempio n. 1
0
        public ActionResult NewQuery(BlueprintQueryParameters queryParameters)
        {
            if (queryParameters == null)
            {
                return(this.Problem(ProblemFactory.BadParameters()));
            }

            var canQueryResult = CommandHandler.CanQueryBlueprints();

            return(canQueryResult.Match(
                       // Will create a Location header with a URI to the result.
                       available => this.CreatedQuery(typeof(BlueprintQueryResultHto), queryParameters),
                       notAvailable => this.Problem(ProblemFactory.OperationNotAvailable()),
                       notReachable => this.Problem(ProblemFactory.ServiceUnavailable()),
                       error => this.Problem(ProblemFactory.Exception(error.Exception))
                       ));
        }