static async Task Main(string[] args)
        {
            var grpcChannel        = GrpcChannel.ForAddress("https://localhost:5001");
            var movieServiceClient = new MovieService.MovieServiceClient(grpcChannel);
            var movieResponse      = await movieServiceClient.GetMoviesAsync(new Empty());

            foreach (var movie in movieResponse.Movies)
            {
                PrintMovie(movie);
            }

            Console.WriteLine("______________________________");

            var asynServerStreamingCall = movieServiceClient.GetMoviesStream(new Empty());

            await foreach (var movie in asynServerStreamingCall.ResponseStream.ReadAllAsync())
            {
                PrintMovie(movie);
            }

            Console.ReadKey();
        }
示例#2
0
 public MovieMutations(MovieService.MovieServiceClient movieService, IMapper mapper)
 {
     _movieService = movieService ?? throw new ArgumentNullException(nameof(movieService));
     _mapper       = mapper ?? throw new ArgumentNullException(nameof(mapper));
 }