Esempio n. 1
0
 private static IEnumerable <OutgoingFriendInvitation> GetOutgoingFriendInvitations(IUserDatabase userDatabase, IInternalLocalUser localUser)
 {
     return((from friendInvitationDoc in userDatabase.GetFriendInvitationDocuments(isInviter : true)
             where userDatabase.GetUserByDisplayName(friendInvitationDoc.DisplayName) != null
             select friendInvitationDoc).Select(delegate(FriendInvitationDocument friendInvitationDoc)
     {
         UserDocument userByDisplayName = userDatabase.GetUserByDisplayName(friendInvitationDoc.DisplayName);
         string displayName = userByDisplayName.DisplayName;
         IInternalUnidentifiedUser invitee = RemoteUserFactory.CreateUnidentifiedUser(displayName, userByDisplayName.FirstName, userDatabase);
         bool isTrusted = friendInvitationDoc.IsTrusted;
         OutgoingFriendInvitation outgoingFriendInvitation = new OutgoingFriendInvitation(localUser, invitee, isTrusted);
         outgoingFriendInvitation.SendComplete(friendInvitationDoc.FriendInvitationId);
         return outgoingFriendInvitation;
     }).ToList());
 }