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;
 }
Example #3
0
        private void SetCredentialByStoreId(Guid value)
        {
            DbCredentialSet credentialToAssign = this.storedCredentials[value];

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

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

            if (credentialSet == null)
            {
                return;
            }

            this.database.CredentialBase.Attach(credentialSet);
        }
Example #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);
     }
 }