public async Task <Result <bool> > AcceptFollowRequest(FollowRequest followRequest) { if (followRequest == null) { throw new ArgumentNullException("createFollowRequest"); } var result = new Result <bool>(); if (followRequest.FolloweeId < 1) { result.ErrorMessages.Add("FolloweeId cannot be less than 1"); } if (followRequest.FollowerId < 1) { result.ErrorMessages.Add("FollowerId cannot be less than 1"); } if (followRequest.FollowerId == followRequest.FolloweeId) { result.ErrorMessages.Add("Kuch Bhi? -_-"); } if (result.ErrorMessages.Count > 0) { return(result); } var follow = await _followRepository.GetFollow(followRequest.FollowerId, followRequest.FolloweeId); if (follow == null || follow.Id < 1) { result.ErrorMessages.Add("Could not find Follow request"); return(result); } if (follow.Status == FollowStatus.Accepted) { result.ErrorMessages.Add("Request Already Accepted"); return(result); } await _followRepository.UpdateStatus(follow.Id, FollowStatus.Accepted); var userEvent = new UserEvent { EventType = UserEventType.FollowRequestAccept, FollowId = follow.Id }; _userEventsPublisher.Publish(userEvent); result.SuccessResult = true; return(result); }