Esempio n. 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();
        }
Esempio n. 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);
            }
        }