/// <summary> /// Initializes a new instance of the <see cref="DataClassAdapter<T>"/> class. /// </summary> /// <param name="connection">Database Connection to be used by the adapter</param> /// <param name="tableName">Name of the table to use for the data mapping.</param> /// <param name="keyFields">Names of the key fields in the table/object</param> /// <param name="schemaVersion">Version of table schema to use</param> public DataClassAdapter(DbConnection connection, string tableName, string[] keyFields, int schemaVersion) { _objectType = typeof(T); _dataMap = DataMap.GenerateCached(_objectType, tableName, keyFields, schemaVersion); Connection = connection; }
/// <summary> /// Initializes a new instance of the <see cref="DataClassAdapter<T>"/> class. /// </summary> /// <param name="connection">Database Connection to be used by the adapter</param> /// <param name="tableName">Name of the table to use for the data mapping.</param> public DataClassAdapter(DbConnection connection, string tableName) { _objectType = typeof(T); _dataMap = DataMap.GenerateCached(_objectType, tableName, null, DataClassAdapter.DefaultSchemaVersion ?? 0); Connection = connection; }
/// <summary> /// Initializes a new instance of the <see cref="DataClassAdapter<T>"/> class. /// </summary> /// <param name="connection">Database Connection to be used by the adapter</param> /// <param name="schemaVersion">Version of table schema to use</param> public DataClassAdapter(DbConnection connection, int schemaVersion) { _objectType = typeof(T); _dataMap = DataMap.GenerateCached(_objectType, null, null, schemaVersion); Connection = connection; }
/// <summary> /// Default constructor - must assign connection before use /// </summary> public DataClassAdapter() { _objectType = typeof(T); _dataMap = DataMap.GenerateCached(_objectType, null, null, 0); }
/// <summary> /// Initializes a new instance of the <see cref="DataClassAdapter<T>"/> class. /// </summary> /// <param name="connection">Database Connection to be used by the adapter</param> /// <param name="tableName">Name of the table to use for the data mapping.</param> /// <param name="keyFields">Names of the key fields in the table/object</param> public DataClassAdapter(DbConnection connection, string tableName, string[] keyFields) { _objectType = typeof(T); DataMap = DataMap.GenerateCached(_objectType, tableName, keyFields, DefaultSchemaVersion ?? 0); Connection = connection; }
/// <summary> /// Initializes a new instance of the <see cref="DataClassAdapter<T>"/> class. /// </summary> /// <param name="connection">Database Connection to be used by the adapter</param> public DataClassAdapter(DbConnection connection) { _objectType = typeof(T); DataMap = DataMap.GenerateCached(_objectType, null, null, DefaultSchemaVersion ?? 0); Connection = connection; }