/// <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(); }
/// <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(); }