Esempio n. 1
0
 public void SaveUserInterest(UserInterest userInterest)
 {
     _userInterestRepository.SaveOrUpdate(userInterest);
 }
Esempio n. 2
0
 public virtual void RemoveInterest(UserInterest interest)
 {
     _interests.Remove(interest);
     UpdateLastActivity();
 }
Esempio n. 3
0
 public void DeleteUserInterest(UserInterest userInterest)
 {
     _userInterestRepository.Delete(userInterest);
 }
Esempio n. 4
0
        public virtual UserInterest AddInterest(Interest interest, int? socialityPoints)
        {
            var existingUserInterest = _interests.FirstOrDefault(x => x.Interest == interest);

            if (existingUserInterest == null)
            {
                existingUserInterest = new UserInterest
                {
                    User = this,
                    Interest = interest,
                    SocialityPoints = socialityPoints
                };

                _interests.Add(existingUserInterest);
            }

            UpdateLastActivity();

            return existingUserInterest;
        }