示例#1
0
        public int[] RemoveInterest(RemoveInterest interestsToRemove)
        {
            Member currentMemb = GetMember(interestsToRemove.MemberId);

            if (!currentMemb.Interests.Intersect(interestsToRemove.InterestId).Any())
            {
                throw new Exception("Ya done goofed");
            }
            currentMemb.Interests.RemoveAll(membersInterests =>
                                            interestsToRemove
                                            .InterestId
                                            .Contains(membersInterests));

            return(interestsToRemove.InterestId);
        }
示例#2
0
 public ActionResult <int[]> DeleteInterest(RemoveInterest interestRequest)
 {
     return(_memberRepo.RemoveInterest(interestRequest));
 }