Esempio n. 1
0
        public async Task <IActionResult> SendFriendRequest(string id)
        {
            Relationship relationship = new Relationship()
            {
                Requester = GetCurrentUserId(),
                Requestee = id
            };

            var doesRelationshipExist = await RelationshipRepository.CheckIfRelationshipAlreadyExists(relationship.Requester, relationship.Requestee);

            if (!doesRelationshipExist)
            {
                await RelationshipRepository.Create(relationship);
            }
            return(RedirectToAction("Profile", new { id }));
        }