Spontaneous.WebApp.Services.UserProfileFacade.TurnOffMedalFlag C# (CSharp) Method

TurnOffMedalFlag() private method

private TurnOffMedalFlag ( ) : bool
return bool
        internal bool TurnOffMedalFlag()
        {
            var userProfile = GetUserProfile();
            var userData = userProfile.GetUserData();

            if (userData == null)
            {
                log.WarnFormat("[TurnOffMedalFlag] User={0} tried to turn off MedalsNotificationFlag, but userData doesn't exists.", userProfile.UserName);
                return false;
            }

            userData.MedalNotificationFlag = false;

            userProfile.SetUserData(userData);
            userProfile.Save();
            log.InfoFormat("[TurnOffMedalFlag] user={0}", userProfile.UserName);
            return true;
        }