public List <GetAllInterest_Result> interest([FromBody] UserSkills skill) { List <GetAllInterest_Result> temp = new List <GetAllInterest_Result>(); List <GetAllInterest_Result> result = new List <GetAllInterest_Result>(); List <GetUserInterests_Result> checkList = new List <GetUserInterests_Result>(); FRDBEntities db = new FRDBEntities(); using (db) { checkList = db.GetUserInterests(skill.email).ToList <GetUserInterests_Result>(); temp = db.GetAllInterest().ToList <GetAllInterest_Result>(); foreach (GetAllInterest_Result obj in temp) { if (!(checkList.Any(x => x.name == obj.name))) { result.Add(obj); } } return(result); } }