Exemple #1
0
 public Task Process(GreetingsRequest request, CancellationToken cancellationToken)
 {
     try
     {
         var personId = personRepository.GetPersonName(request.PersonId);
         return(Task.FromResult(0));
     }
     catch (ArgumentNullException ex)
     {
         throw new Exception($"System can't find user with Id {request.PersonId}. Error: {ex.Message}");
     }
 }
        public async Task Process(GreetingsRequest request, GreetingsResponse response, CancellationToken cancellationToken)
        {
            var name = await personRepository.GetPersonName(request.PersonId + 1);

            response.Greeting = $"{response.Greeting}, {name}";
        }