public virtual void RemoveRole(string role)
        {
            if (string.IsNullOrWhiteSpace(role))
            {
                throw new ArgumentNullException(nameof(role));
            }

            _roles.Remove(role);
            RemovedObjects.Add(role);
        }
        public virtual void RemoveClaim(IdentityClaim userClaim)
        {
            if (userClaim == null)
            {
                throw new ArgumentNullException(nameof(userClaim));
            }

            _claims.Remove(userClaim);
            RemovedObjects.Add(userClaim);
        }
        public virtual void RemoveLogin(IdentityExternalLogin userLogin)
        {
            if (userLogin == null)
            {
                throw new ArgumentNullException(nameof(userLogin));
            }

            _logins.Remove(userLogin);
            RemovedObjects.Add(userLogin);
        }
Example #4
0
 public MruItem RemoveInTail(bool moveToRemoveList)
 {
     if (_tail != null)
     {
         Count--;
         MruItem d = _tail.Data;
         if (_tail.Previous != null)
         {
             _tail.Previous.Next = null;
             _tail = _tail.Previous;
         }
         else
         {
             _tail = null;
             _head = null;
         }
         //if (Collection != null)
         //{
         if (d.Value is Sop.DataBlock)
         {
             if (((DataBlock)d.Value).IsDirty)
             {
                 if (moveToRemoveList && DataDriver != null && !RemovedObjects.ContainsKey(d.Key))
                 {
                     RemovedObjects.Add(d.Key, d.Value);
                 }
             }
         }
         else if (moveToRemoveList && d.Value != null)
         {
             if (!RemovedObjects.ContainsKey(d.Key))
             {
                 if (d.Value is IInternalPersistent)
                 {
                     if (((IInternalPersistent)d.Value).IsDirty)
                     {
                         RemovedObjects.Add(d.Key, d.Value);
                     }
                 }
                 else
                 {
                     RemovedObjects.Add(d.Key, d.Value);
                 }
             }
         }
         //}
         return(d);
     }
     return(null);
 }
Example #5
0
 public MruItem <TKey, TValue> RemoveInTail(bool moveToRemoveList)
 {
     if (_tail != null)
     {
         Count--;
         MruItem <TKey, TValue> d = _tail.Data;
         if (_tail.Previous != null)
         {
             _tail.Previous.Next = null;
             _tail = _tail.Previous;
         }
         else
         {
             _tail = null;
             _head = null;
         }
         if (d.Value is Sop.DataBlock)
         {
             //** check whether this needs to be supported..
             //if (((DataBlock)d.Value).IsDirty)
             //{
             //    if (MoveToRemoveList && DataDriver != null && !RemovedObjects.ContainsKey(d.Value))
             //        RemovedObjects.Add(d.Value, d.Value);
             //}
         }
         else if (moveToRemoveList)
         {
             /*d.Value != null && 90;*/
             if (!RemovedObjects.ContainsKey(d.Key))
             {
                 if (d.Value is IInternalPersistent)
                 {
                     if (((IInternalPersistent)d.Value).IsDirty)
                     {
                         RemovedObjects.Add(d.Key, d.Value);
                     }
                 }
                 else
                 {
                     RemovedObjects.Add(d.Key, d.Value);
                 }
             }
         }
         return(d);
     }
     return(null);
 }