public override async Task <BlockPlayerResponse> BlockPlayer(BlockPlayerRequest request, ServerCallContext context) { RedisUserModel user = context.UserState["user"] as RedisUserModel; if (user == null) { return new BlockPlayerResponse() { Status = ResponseFactory.createResponse(ResponseType.UNAUTHORIZED) } } ; RedisUserModel friend = await RedisUserModel.GetUserFromGuid(request.UserIdToBlock); if (friend == null) { return new BlockPlayerResponse() { Status = ResponseFactory.createResponse(ResponseType.PLAYER_DOES_NOT_EXIST) } } ; if (await user.IsBlocked(friend)) { return new BlockPlayerResponse() { Status = ResponseFactory.createResponse(ResponseType.DUPLICATE) } } ; await user.BlockUser(friend); return(new BlockPlayerResponse() { Status = ResponseFactory.createResponse(ResponseType.SUCCESS) }); }