Esempio n. 1
0
 /// <summary>
 /// Adds a <see cref="AuthScopeItem"/>. Existing scope with the same <see cref="AuthScopeItem.ScopeName"/> is replaced.
 /// </summary>
 /// <param name="scope">The scope to add.</param>
 public void Add(AuthScopeItem scope)
 {
     if (scope == null)
     {
         throw new ArgumentNullException(nameof(scope));
     }
     _wrapper.Scopes[scope.ScopeName] = scope;
 }
Esempio n. 2
0
        /// <summary>
        /// Removes the scope with the same <see cref="AuthScopeItem.ScopeName"/> and <see cref="AuthScopeItem.Status"/>.
        /// </summary>
        /// <param name="scope">The scope to remove.</param>
        /// <returns>True on success, false if not found.</returns>
        public bool Remove(AuthScopeItem scope)
        {
            if (scope == null)
            {
                throw new ArgumentNullException(nameof(scope));
            }
            AuthScopeItem s;

            return(_wrapper.Scopes.TryGetValue(scope.ScopeName, out s) && s.Status == scope.Status && _wrapper.Scopes.Remove(scope.ScopeName));
        }