예제 #1
0
        /// <summary>
        /// </summary>
        /// <param name="connection"></param>
        public TarkOrm(IDbConnection connection)
        {
            if (connection == null)
            {
                throw new ArgumentNullException("connection");
            }

            _connection  = connection;
            QueryBuilder = new TarkQueryBuilder(this);
            Transformer  = new TarkTransformer();
        }
예제 #2
0
        /// <summary>
        /// </summary>
        /// <param name="nameOrConnectionString">Either the database name or a connection string.</param>
        public TarkOrm(string nameOrConnectionString)
        {
            var connectionSetting = ConfigurationManager.ConnectionStrings[nameOrConnectionString];

            if (connectionSetting != null)
            {
                nameOrConnectionString = connectionSetting.ConnectionString;
            }

            _connection  = new System.Data.SqlClient.SqlConnection(nameOrConnectionString);
            QueryBuilder = new TarkQueryBuilder(this);
            Transformer  = new TarkTransformer();
        }