Exemplo n.º 1
0
        private T GetUserSettingFromCookie <T>() where T : class, IUserConfiguration <T>, new()
        {
            var key = GetUserConfigurationCookieName <T>();

            T value;

            if (!_cookieManager.ContainsKey(key))
            {
                value = new T().GetDefault();
                _cookieManager.Append(key, value);

                return(value);
            }

            value = _cookieManager.GetValue <T>(key);

            return(value);
        }