public async Task <TResult> ProcessAsync <TResult>(IQueryEntity <TResult> query)
        {
            this.logger.LogDebug($"Async Processing query {query}");

            var handlerType = typeof(IAsyncQueryHandler <,>).MakeGenericType(query.GetType(), typeof(TResult));

            dynamic handler = this.serviceProvider.GetService(handlerType);

            var queryResult = await handler?.ExecuteAsync((dynamic)query).ConfigureAwait(false);

            return(queryResult);
        }
        public TResult Process <TResult>(IQueryEntity <TResult> query)
        {
            this.logger.LogDebug($"Processing query {query}");

            var handlerType = typeof(IQueryHandler <,>).MakeGenericType(query.GetType(), typeof(TResult));

            dynamic handler = this.serviceProvider.GetService(handlerType);

            var queryResult = handler?.Execute((dynamic)query);

            return(queryResult);
        }
Exemplo n.º 3
0
 public JoinedEntity(JoinOperator joinOperator, string parentEntityName, string parentAttributeName, string relatedEntityName, string relatedAttributeName, IQueryEntity <P, E> parent) : base()
 {
     this.JoinOperator     = joinOperator;
     this.ParentEntity     = parentEntityName;
     this.ParentAttribute  = parentAttributeName;
     this.RelatedEntity    = relatedEntityName;
     this.RelatedAttribute = relatedAttributeName;
 }