コード例 #1
0
        protected CachedCookie Add(string cookieName)
        {
            var cookie = new CachedCookie
            {
                Name = cookieName
            };

            _pendingCookies.Add(cookieName, cookie);

            return(cookie);
        }
コード例 #2
0
        protected CachedCookie Delete(string cookieName)
        {
            //We want to make sure that subsequent queries for that same cookie know it is deleted as we’ve seen in the Get<T> call. For this to work properly we need our local cache to track that.
            if (_pendingCookies.TryGetValue(cookieName, out CachedCookie cookie))
            {
                cookie.IsDeleted = true;
            }
            else
            {
                cookie = new CachedCookie
                {
                    Name      = cookieName,
                    IsDeleted = true
                };
                _pendingCookies.Add(cookieName, cookie);
            }

            return(cookie);
        }