Exemplo n.º 1
0
        public UserService(IConfiguration configs)
        {
            _configs = configs;
            var channel = GrpcChannel.ForAddress(_configs["Services:Grpc:Authorization"]);

            _grpcClient = new UsersGrpcClient(channel);
        }
        public async Task <UserModel> GetUserAsync(string id)
        {
            return(await GrpcCallerService.CallService(_urls.GrpcUsers, async channel =>
            {
                var client = new UsersGrpc.UsersGrpcClient(channel);

                var response = await client.GetUserAsync(new UserRequest {
                    Id = id
                });

                return MapToUserData(response);
            }));
        }
Exemplo n.º 3
0
 public UsersGrpcClient(UsersGrpc.UsersGrpcClient grpcClient)
 {
     _grpcClient = grpcClient;
 }
Exemplo n.º 4
0
 public UserService(UsersGrpcClient usersGrpcClient)
 {
     _grpcClient = usersGrpcClient;
 }