Beispiel #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);
        }
 public ActionResult <int[]> DeleteInterest(RemoveInterest interestRequest)
 {
     return(_memberRepo.RemoveInterest(interestRequest));
 }