예제 #1
0
        private void RunQuery <T>(IQuery <T> query) where T : class
        {
            ActionDataProvider.ProvideValue(query);
            var result            = _mediator.Query(query);
            var queryResultSchema = QueryResultSchema.FromQueryResult(result);

            new QueryResultSchemaDataProvider(queryResultSchema).Write();
        }
예제 #2
0
        private void RunCommand <T>(T command) where T : ICommand
        {
            ActionDataProvider.ProvideValue(command);
            var result = _mediator.Command(command);

            if (result.IsFailure)
            {
                throw new Exception(result.ErrorMessage);
            }
        }