AspNetCore.Docs/aspnetcore/grpc/deadlines-cancellation/deadline-propagate.cs

10 lines
309 B
C#

public override async Task<UserResponse> GetUser(UserRequest request,
ServerCallContext context)
{
var client = new User.UserServiceClient(_channel);
var response = await client.GetUserAsync(
new UserRequest { Id = request.Id },
deadline: context.Deadline);
return response;
}