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; }
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); }
private void AttachCredentialBase(DbSecurityOptions security) { if (security.CachedCredentials == null) { return; } security.CredentialBase = security.CachedCredentials; this.database.CredentialBase.Attach(security.CachedCredentials); }
private void MarkSecurityAsModified(DbSecurityOptions security) { this.MarkAsModified(security); if (security.CachedCredentials != null) { this.MarkCachedCredentials(security); } security.UpdateCredentialSetReference(); }
private void AttachCredentialSet(DbSecurityOptions security) { var credentialSet = security.ResolveCredentailFromStore(); if (credentialSet == null) { return; } this.database.CredentialBase.Attach(credentialSet); }
/// <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); } }
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); }
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; }