Ejemplo n.º 1
0
 internal void UpdateFrom(DbSecurityOptions source)
 {
     this.EncryptedUserName = source.EncryptedUserName;
     this.EncryptedDomain   = source.EncryptedDomain;
     this.EncryptedPassword = source.EncryptedPassword;
     this.credentialId      = source.credentialId;
     this.storedCredentials = source.storedCredentials;
 }
Ejemplo n.º 2
0
        public ISecurityOptions Copy()
        {
            var copy = new DbSecurityOptions();

            // newCachedCredentials doesn't have to be assigned here, because it depends on the values copied
            copy.UpdateFrom(this);
            return(copy);
        }
Ejemplo n.º 3
0
        private void AttachCredentialBase(DbSecurityOptions security)
        {
            if (security.CachedCredentials == null)
            {
                return;
            }

            security.CredentialBase = security.CachedCredentials;
            this.database.CredentialBase.Attach(security.CachedCredentials);
        }
Ejemplo n.º 4
0
        private void MarkSecurityAsModified(DbSecurityOptions security)
        {
            this.MarkAsModified(security);
            if (security.CachedCredentials != null)
            {
                this.MarkCachedCredentials(security);
            }

            security.UpdateCredentialSetReference();
        }
Ejemplo n.º 5
0
        private void AttachCredentialSet(DbSecurityOptions security)
        {
            var credentialSet = security.ResolveCredentailFromStore();

            if (credentialSet == null)
            {
                return;
            }

            this.database.CredentialBase.Attach(credentialSet);
        }
Ejemplo n.º 6
0
 /// <summary>
 ///     Because of CachedCredentialBase lazy loading, we have to distinguish, how to save the property manually
 /// </summary>
 private void MarkCachedCredentials(DbSecurityOptions security)
 {
     if (security.NewCachedCredentials)
     {
         this.database.Entry(security.CachedCredentials).State = EntityState.Added;
     }
     else
     {
         this.MarkAsModified(security.CachedCredentials);
     }
 }
Ejemplo n.º 7
0
        private void DetachSecurity(DbSecurityOptions security)
        {
            if (security.CredentialSet != null)
            {
                this.Detach(security.CredentialSet);
            }

            // check the reference, not local cached field
            if (security.CredentialBase != null)
            {
                this.Detach(security.CachedCredentials);
            }

            this.Detach(security);
        }
Ejemplo n.º 8
0
 private void Attach(DbSecurityOptions security)
 {
     this.database.Security.Attach(security);
     this.AttachCredentialBase(security);
     this.AttachCredentialSet(security);
 }
 internal void UpdateFrom(DbSecurityOptions source)
 {
     this.EncryptedUserName = source.EncryptedUserName;
     this.EncryptedDomain = source.EncryptedDomain;
     this.EncryptedPassword = source.EncryptedPassword;
     this.credentialId = source.credentialId;
     this.storedCredentials = source.storedCredentials;
     this.persistenceSecurity = source.persistenceSecurity;
 }
 internal DbSecurityOptions Copy()
 {
     var copy = new DbSecurityOptions();
     // newCachedCredentials doesn't have to be assigned here, because it depends on the values copied
     copy.UpdateFrom(this);
     return copy;
 }