コード例 #1
0
        public List <TRS_Domain.INTEREST.Data> GetUserCategoryInterests(int categoryId, int userId)
        {
            // get category interests
            List <TRS_Domain.INTEREST.Data> categoryInterests = new List <Data>(_interestRepo.GetUserCategoryInterests(categoryId, userId));
            // get user interests
            List <TRS_Domain.INTEREST.Data> userInterests = new List <Data>(_interestRepo.GetUserInterests(userId));

            foreach (var s in userInterests)
            {
                // check if categoryInterest already exists in user interest list
                categoryInterests.RemoveAll((x) => x.InterestId == s.InterestId);
            }

            return(categoryInterests);
        }