public bool Set(string username, bool offers, bool newsletters) { if (string.IsNullOrWhiteSpace(username)) { return(false); } var newsletterSucccess = UpdateNewsletterOptIns.Update(username, newsletters); var offerSuccess = UpdateOfferUserOptIn.Update(username, offers); return(offerSuccess && newsletterSucccess); }
public bool Update(bool optIn) { if (!UserContext.IsAuthenticated) { return(false); } var success = UpdateOfferOptIn.Update(UserContext.User?.Username, optIn); if (success) { OfferOptedInContext.Clear(); } return(success); }