Beispiel #1
0
        public override Task <RemoveFriendResponse> RemoveFriend(RemoveFriendRequest request, ServerCallContext context)
        {
            _friendsService.RemoveFriend(Guid.Parse(request.UserId), Guid.Parse(request.FriendId));
            var response = new RemoveFriendResponse();

            return(Task.FromResult(response));
        }
 public RemoveFriendResponse RemoveFriend(string friendID)
 {
     RemoveFriendResponse response = new RemoveFriendResponse();
     RelationshipService relationshipSvc = new RelationshipService(_repository);
     try
     {
         relationshipSvc.ModifyFriendsList(RelationshipService.Operation.RemoveFriend, _currentTravelerId, new Guid(friendID));
         response.MarkSuccess();
     }
     catch (Exception ex)
     {
         ReportError(ex, response);
     }
     return response;
 }
 /// <summary>
 /// If the TPS service no longer wants to interact anymore with an existing friend, the TPS can break the friendship
 /// relation. Immediately after this call, messaging is no longer possible between the service and the friend in
 /// either direction.
 /// </summary>
 /// <returns> RemoveFriendResponse object</returns>
 /// <param name="request"> RemoveFriendRequest object</param>
 /// <param name='jsonRpcCallId'>
 /// The json rpc call identifier. This is a string generated by the client, which can be used to correlate the response to the request. Max length is 256 characters. A JSON-RPC id must be generated on a per call invocation basis. The Rogerthat platform uses the id of the call to store the call result for a certain amount of time so that if something fails during the communication, the same call (having the same JSON-RPC id) can be resent to the Rogerthat service, allowing to fetch the result, without actually executing the call again. This avoids annoying problems such as duplicate delivery of messages.
 /// 
 /// You should use a different JSON-RPC id for every call you make.
 /// 
 /// In case of an intermittent failure such as a network connectivity problem, you can retry the same call using the same JSON-RPC id, without running the risk of duplicate execution of your call (e.g. duplicate message delivery).
 /// </param>
 public RemoveFriendResponse RemoveFriend(RemoveFriendRequest request, string jsonRpcCallId)
 {
     RemoveFriendResponse result = new RemoveFriendResponse();
     WireRequest(0, jsonRpcCallId, "friend.break_up", (writer) =>
     {
         request.Write(writer, false);
     }, (reader) =>
     {
         result.Read(reader);
     }
     );
     return result;
 }