﻿using appfactum.core;
using System.Data.SqlClient;

namespace appfactum.mssql
{
    public class MSSQLConnection : BaseConnection<SqlConnection, SqlCommand, SqlParameter, SqlTransaction>, IConnection
    {
        #region constructors
        /// <summary>
        /// Avoid using the standard constructor from anywhere.
        /// </summary>
        private MSSQLConnection() { }

        /// <summary>
        /// interner Constructor, damit eine neue Verbindung nur über GetConnection erzeugt werden kann
        /// </summary>
        /// <param name="database">Datenbank zu der die Verbindung erstellt wird</param>
        internal MSSQLConnection(MSSQLDatabase database)
        {
            Database = database;
            Connection = new SqlConnection(database.Configuration.ConnectionString);
            Connection.Open();
        }
        #endregion
    }
}
