Esempio n. 1
0
 public async Task Handle(T command)
 {
     if (_authoriser is null)
     {
         throw new UnauthorizedAccessException("Unauthorised");
     }
     _authoriser.ValidateAndThrow(command);
     await _handler.Handle(command);
 }
 public async Task <TResult> HandleAsync(TQuery query)
 {
     if (_authoriser is null)
     {
         throw new UnauthorizedAccessException("Unauthorised");
     }
     _authoriser.ValidateAndThrow(query);
     return(await _handler.HandleAsync(query));
 }