Exemple #1
0
        internal DataAccessCredentials(ICatalogueRepository repository, DbDataReader r)
            : base(repository, r)
        {
            _encryptedPasswordHost = new EncryptedPasswordHost(repository);

            Name     = (string)r["Name"];
            Username = r["Username"].ToString();
            Password = r["Password"].ToString();
        }
Exemple #2
0
        /// <summary>
        /// Records a new (initially blank) set of credentials that can be used to access a <see cref="TableInfo"/> or other object requiring authentication.
        /// <para>A single <see cref="DataAccessCredentials"/> can be shared by multiple tables</para>
        ///
        /// <para>You can also use <see cref="DataAccessCredentialsFactory"/> for easier credentials creation</para>
        /// </summary>
        /// <param name="repository"></param>
        /// <param name="name"></param>
        public DataAccessCredentials(ICatalogueRepository repository, string name = null)
        {
            name = name ?? "New Credentials " + Guid.NewGuid();

            _encryptedPasswordHost = new EncryptedPasswordHost(repository);

            repository.InsertAndHydrate(this, new Dictionary <string, object>
            {
                { "Name", name }
            });
        }