Exemple #1
0
        public Task SendAsync <TCommand>(TCommand command) where TCommand : ICommand
        {
            Type cType   = command.GetType();
            var  impType = FindCommandType.Find(cType, dependencies);

            InvokeMethod(impType, cType, command);
            return(Task.CompletedTask);
        }
Exemple #2
0
 public async Task <TResponse> GetAsync <TQuery, TResponse>(IQuery query) where TQuery : IQuery
 {
     return(await Task.Run(() => {
         Type cType = query.GetType();
         var impType = FindCommandType.Find(cType, dependencies);
         Task <TResponse> obj = (Task <TResponse>)InvokeMethod(impType, cType, query);
         var result = (TResponse)obj.Result;
         return result;
     }));
 }