public void DbCredentialsetValidationTest()
 {
     var credentailSet = new DbCredentialSet();
     credentailSet.Name = longText;
     var results = Validations.Validate(credentailSet);
     Assert.AreEqual(2, results.Count(), "CredentailSet validation failed");
 }
 internal DbCredentialSet Copy()
 {
     var copy = new DbCredentialSet
         {
             Name = this.Name
         };
     CopyTo(copy);
     return copy;
 }
예제 #3
0
        private void SetCredentialByStoreId(Guid value)
        {
            DbCredentialSet credentialToAssign = this.storedCredentials[value];

            if (credentialToAssign != null)
            {
                this.credentialId = credentialToAssign.Id;
            }
        }
예제 #4
0
 private static void DeleteFromDatabase(DbCredentialSet credentailToRemove)
 {
     using (var database = DatabaseConnections.CreateInstance())
     {
         database.CredentialBase.Attach(credentailToRemove);
         database.CredentialBase.Remove(credentailToRemove);
         database.SaveImmediatelyIfRequested();
     }
 }
예제 #5
0
 private static void AddToDatabase(DbCredentialSet credentialToAdd)
 {
     using (var database = DatabaseConnections.CreateInstance())
     {
         database.CredentialBase.Add(credentialToAdd);
         database.SaveImmediatelyIfRequested();
         database.Cache.Detach(credentialToAdd);
     }
 }
예제 #6
0
        internal DbCredentialSet Copy()
        {
            var copy = new DbCredentialSet
            {
                Name = this.Name
            };

            CopyTo(copy);
            return(copy);
        }
예제 #7
0
        private void AttachCredentialSet(DbSecurityOptions security)
        {
            DbCredentialSet credentialSet = security.ResolveCredentailFromStore();

            if (credentialSet == null)
            {
                return;
            }

            this.database.CredentialBase.Attach(credentialSet);
        }
예제 #8
0
        private Guid GetCredential()
        {
            DbCredentialSet resolved = this.ResolveCredentailFromStore();

            if (resolved != null)
            {
                return(resolved.Guid);
            }

            return(Guid.Empty);
        }
 private static void DeleteFromDatabase(DbCredentialSet credentailToRemove)
 {
     using (Database database = DatabaseConnections.CreateInstance())
     {
         database.CredentialBase.Attach(credentailToRemove);
         database.CredentialBase.Remove(credentailToRemove);
         database.SaveImmediatelyIfRequested();
     }
 }
 private static void AddToDatabase(DbCredentialSet credentialToAdd)
 {
     using (Database database = DatabaseConnections.CreateInstance())
     {
         database.CredentialBase.Add(credentialToAdd);
         database.SaveImmediatelyIfRequested();
         database.Cache.Detach(credentialToAdd);
     }
 }