Beispiel #1
0
 public bool DeleteInterest(string userId, string interestId)
 {
     try
     {
         //Validate user
         if (_userRepository.IsAuthenticated(userId))
         {
             //GetUserProfile
             var interest = _interestRepository.GetInterestById(interestId);
             if (interest != null)
             {
                 //Success
                 var isDeleted = _interestRepository.DeleteInterest(interest.Id.ToString());
                 if (isDeleted)
                 {
                     return(_interestRepository.Save());
                 }
             }
             _loggingService.Info("Not profile for the user found: " + userId);
         }
         _loggingService.Info("UserId Authenticated Failed: " + userId);
     }
     catch (Exception ex)
     {
         //Error
         _loggingService.Error("An error has occurred", ex);
     }
     //Fail
     return(false);
 }