Class DbDataStores<TConfiguration>.DataConnection
Inheritance
Inherited Members
Namespace: ArgentSea
Assembly: ArgentSea.dll
Syntax
public class DataConnection
Properties
| Improve this Doc View SourceConnectionString
Declaration
public string ConnectionString { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
| Improve this Doc View SourceListAsync<TResult>(String, DbParameterCollection, CancellationToken)
Connect to the database and return the values as a list of objects.
Declaration
public Task<IList<TResult>> ListAsync<TResult>(string sprocName, DbParameterCollection parameters, CancellationToken cancellationToken)
where TResult : class, new()
Parameters
Type | Name | Description |
---|---|---|
System.String | sprocName | The stored procedure to call to fetch the data. |
System.Data.Common.DbParameterCollection | parameters | The query parameters. |
System.Threading.CancellationToken | cancellationToken | A token to cancel the asynchronous operation. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.IList<TResult>> | A list containing an object for each data row. |
Type Parameters
Name | Description |
---|---|
TResult | The type of object to be listed. |
LookupAsync<TValue>(String, DbParameterCollection, CancellationToken)
Connect to the database and return a single value.
Declaration
public Task<TValue> LookupAsync<TValue>(string sprocName, DbParameterCollection parameters, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.String | sprocName | The stored procedure to call to fetch the value. |
System.Data.Common.DbParameterCollection | parameters | A parameters collction. Input parameters may be used to find the parameter; will return the value of the first output (or input/output) parameter. If TValue is an int, will also return the sproc return value. |
System.Threading.CancellationToken | cancellationToken | A token to cancel the asynchronous operation. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<TValue> | The retrieved value. |
Type Parameters
Name | Description |
---|---|
TValue | The expected type of the return value. |
QueryAsync<TModel>(String, DbParameterCollection, QueryResultModelHandler<Int32, Object, TModel>, Boolean, CancellationToken)
Declaration
public Task<TModel> QueryAsync<TModel>(string sprocName, DbParameterCollection parameters, QueryResultModelHandler<int, object, TModel> resultHandler, bool isTopOne, CancellationToken cancellationToken)
where TModel : class, new()
Parameters
Type | Name | Description |
---|---|---|
System.String | sprocName | |
System.Data.Common.DbParameterCollection | parameters | |
QueryResultModelHandler<System.Int32, System.Object, TModel> | resultHandler | |
System.Boolean | isTopOne | |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<TModel> |
Type Parameters
Name | Description |
---|---|
TModel |
QueryAsync<TModel>(String, DbParameterCollection, CancellationToken)
Connect to the database and return an object of the specified type built from the corresponding output parameters.
Declaration
public Task<TModel> QueryAsync<TModel>(string sprocName, DbParameterCollection parameters, CancellationToken cancellationToken)
where TModel : class, new()
Parameters
Type | Name | Description |
---|---|---|
System.String | sprocName | The stored procedure to call to fetch the data. |
System.Data.Common.DbParameterCollection | parameters | The query parameters. |
System.Threading.CancellationToken | cancellationToken | A token to cancel the asynchronous operation. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<TModel> |
Type Parameters
Name | Description |
---|---|
TModel | The type of the object to be returned. |
QueryAsync<TModel, TReaderResult0, TReaderResult1, TReaderResult2, TReaderResult3, TReaderResult4, TReaderResult5, TReaderResult6, TReaderResult7, TOutParameters>(String, DbParameterCollection, CancellationToken)
Connect to the database and return an object of the specified type built from the corresponding data reader results and/or output parameters.
Declaration
public Task<TModel> QueryAsync<TModel, TReaderResult0, TReaderResult1, TReaderResult2, TReaderResult3, TReaderResult4, TReaderResult5, TReaderResult6, TReaderResult7, TOutParameters>(string sprocName, DbParameterCollection parameters, CancellationToken cancellationToken)
where TModel : class, new()
where TReaderResult0 : class, new()
where TReaderResult1 : class, new()
where TReaderResult2 : class, new()
where TReaderResult3 : class, new()
where TReaderResult4 : class, new()
where TReaderResult5 : class, new()
where TReaderResult6 : class, new()
where TReaderResult7 : class, new()
where TOutParameters : class, new()
Parameters
Type | Name | Description |
---|---|---|
System.String | sprocName | The stored procedure to call to fetch the data. |
System.Data.Common.DbParameterCollection | parameters | The query parameters. |
System.Threading.CancellationToken | cancellationToken | A token to cancel the asynchronous operation. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<TModel> |
Type Parameters
Name | Description |
---|---|
TModel | This is the expected return type of the query. |
TReaderResult0 | The first result set from data reader will be mapped an object or property of this type. |
TReaderResult1 | The second result set from data reader will be mapped an object or property of this type.. |
TReaderResult2 | The third result set from data reader will be mapped an object or property of this type. |
TReaderResult3 | The forth result set from data reader will be mapped an object or property of this type. |
TReaderResult4 | The fifth result set from data reader will be mapped an object or property of this type. |
TReaderResult5 | The sixth result set from data reader will be mapped an object or property of this type. |
TReaderResult6 | The seventh result set from data reader will be mapped an object or property of this type. |
TReaderResult7 | The eighth result set from data reader will be mapped an object or property of this type. |
TOutParameters | This must be either type TModel or Mapper.DummyType. If set to TModel the TModel properties will be mapped to cooresponding output parameters; if set to DummyType, the output parameters are ignored. |
QueryAsync<TArg, TModel>(String, DbParameterCollection, QueryResultModelHandler<Int32, TArg, TModel>, Boolean, TArg, CancellationToken)
Declaration
public Task<TModel> QueryAsync<TArg, TModel>(string sprocName, DbParameterCollection parameters, QueryResultModelHandler<int, TArg, TModel> resultHandler, bool isTopOne, TArg optionalArgument, CancellationToken cancellationToken)
where TModel : class, new()
Parameters
Type | Name | Description |
---|---|---|
System.String | sprocName | |
System.Data.Common.DbParameterCollection | parameters | |
QueryResultModelHandler<System.Int32, TArg, TModel> | resultHandler | |
System.Boolean | isTopOne | |
TArg | optionalArgument | |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<TModel> |
Type Parameters
Name | Description |
---|---|
TArg | |
TModel |
QueryAsync<TModel, TReaderResult, TOutParameters>(String, DbParameterCollection, CancellationToken)
Connect to the database and return an object of the specified type built from the corresponding data reader results and/or output parameters.
Declaration
public Task<TModel> QueryAsync<TModel, TReaderResult, TOutParameters>(string sprocName, DbParameterCollection parameters, CancellationToken cancellationToken)
where TModel : class, new()
where TReaderResult : class, new()
where TOutParameters : class, new()
Parameters
Type | Name | Description |
---|---|---|
System.String | sprocName | The stored procedure to call to fetch the data. |
System.Data.Common.DbParameterCollection | parameters | The query parameters. |
System.Threading.CancellationToken | cancellationToken | A token to cancel the asynchronous operation. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<TModel> |
Type Parameters
Name | Description |
---|---|
TModel | This is the expected return type of the query. |
TReaderResult | The data reader result set will be mapped an object or property of this type. If TOutParmaters is set to Mapper.DummyType then this must be a single row result of type TModel. |
TOutParameters | This must be either type TModel or Mapper.DummyType. If set to TModel the TModel properties will be mapped to cooresponding output parameters; if set to DummyType, the output parameters are ignored. |
QueryAsync<TModel, TReaderResult0, TReaderResult1, TReaderResult2, TOutParameters>(String, DbParameterCollection, CancellationToken)
Connect to the database and return an object of the specified type built from the corresponding data reader results and/or output parameters.
Declaration
public Task<TModel> QueryAsync<TModel, TReaderResult0, TReaderResult1, TReaderResult2, TOutParameters>(string sprocName, DbParameterCollection parameters, CancellationToken cancellationToken)
where TModel : class, new()
where TReaderResult0 : class, new()
where TReaderResult1 : class, new()
where TReaderResult2 : class, new()
where TOutParameters : class, new()
Parameters
Type | Name | Description |
---|---|---|
System.String | sprocName | The stored procedure to call to fetch the data. |
System.Data.Common.DbParameterCollection | parameters | The query parameters. |
System.Threading.CancellationToken | cancellationToken | A token to cancel the asynchronous operation. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<TModel> |
Type Parameters
Name | Description |
---|---|
TModel | This is the expected return type of the query. |
TReaderResult0 | The first result set from data reader will be mapped an object or property of this type. |
TReaderResult1 | The second result set from data reader will be mapped an object or property of this type.. |
TReaderResult2 | The third result set from data reader will be mapped an object or property of this type. |
TOutParameters | This must be either type TModel or Mapper.DummyType. If set to TModel the TModel properties will be mapped to cooresponding output parameters; if set to DummyType, the output parameters are ignored. |
QueryAsync<TModel, TReaderResult0, TReaderResult1, TReaderResult2, TReaderResult3, TOutParameters>(String, DbParameterCollection, CancellationToken)
Connect to the database and return an object of the specified type built from the corresponding data reader results and/or output parameters.
Declaration
public Task<TModel> QueryAsync<TModel, TReaderResult0, TReaderResult1, TReaderResult2, TReaderResult3, TOutParameters>(string sprocName, DbParameterCollection parameters, CancellationToken cancellationToken)
where TModel : class, new()
where TReaderResult0 : class, new()
where TReaderResult1 : class, new()
where TReaderResult2 : class, new()
where TReaderResult3 : class, new()
where TOutParameters : class, new()
Parameters
Type | Name | Description |
---|---|---|
System.String | sprocName | The stored procedure to call to fetch the data. |
System.Data.Common.DbParameterCollection | parameters | The query parameters. |
System.Threading.CancellationToken | cancellationToken | A token to cancel the asynchronous operation. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<TModel> |
Type Parameters
Name | Description |
---|---|
TModel | This is the expected return type of the query. |
TReaderResult0 | The first result set from data reader will be mapped an object or property of this type. |
TReaderResult1 | The second result set from data reader will be mapped an object or property of this type.. |
TReaderResult2 | The third result set from data reader will be mapped an object or property of this type. |
TReaderResult3 | The forth result set from data reader will be mapped an object or property of this type. |
TOutParameters | This must be either type TModel or Mapper.DummyType. If set to TModel the TModel properties will be mapped to cooresponding output parameters; if set to DummyType, the output parameters are ignored. |
QueryAsync<TModel, TReaderResult0, TReaderResult1, TReaderResult2, TReaderResult3, TReaderResult4, TOutParameters>(String, DbParameterCollection, CancellationToken)
Connect to the database and return an object of the specified type built from the corresponding data reader results and/or output parameters.
Declaration
public Task<TModel> QueryAsync<TModel, TReaderResult0, TReaderResult1, TReaderResult2, TReaderResult3, TReaderResult4, TOutParameters>(string sprocName, DbParameterCollection parameters, CancellationToken cancellationToken)
where TModel : class, new()
where TReaderResult0 : class, new()
where TReaderResult1 : class, new()
where TReaderResult2 : class, new()
where TReaderResult3 : class, new()
where TReaderResult4 : class, new()
where TOutParameters : class, new()
Parameters
Type | Name | Description |
---|---|---|
System.String | sprocName | The stored procedure to call to fetch the data. |
System.Data.Common.DbParameterCollection | parameters | The query parameters. |
System.Threading.CancellationToken | cancellationToken | A token to cancel the asynchronous operation. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<TModel> |
Type Parameters
Name | Description |
---|---|
TModel | This is the expected return type of the query. |
TReaderResult0 | The first result set from data reader will be mapped an object or property of this type. |
TReaderResult1 | The second result set from data reader will be mapped an object or property of this type.. |
TReaderResult2 | The third result set from data reader will be mapped an object or property of this type. |
TReaderResult3 | The forth result set from data reader will be mapped an object or property of this type. |
TReaderResult4 | The fifth result set from data reader will be mapped an object or property of this type. |
TOutParameters | This must be either type TModel or Mapper.DummyType. If set to TModel the TModel properties will be mapped to cooresponding output parameters; if set to DummyType, the output parameters are ignored. |
QueryAsync<TModel, TReaderResult0, TReaderResult1, TReaderResult2, TReaderResult3, TReaderResult4, TReaderResult5, TOutParameters>(String, DbParameterCollection, CancellationToken)
Connect to the database and return an object of the specified type built from the corresponding data reader results and/or output parameters.
Declaration
public Task<TModel> QueryAsync<TModel, TReaderResult0, TReaderResult1, TReaderResult2, TReaderResult3, TReaderResult4, TReaderResult5, TOutParameters>(string sprocName, DbParameterCollection parameters, CancellationToken cancellationToken)
where TModel : class, new()
where TReaderResult0 : class, new()
where TReaderResult1 : class, new()
where TReaderResult2 : class, new()
where TReaderResult3 : class, new()
where TReaderResult4 : class, new()
where TReaderResult5 : class, new()
where TOutParameters : class, new()
Parameters
Type | Name | Description |
---|---|---|
System.String | sprocName | The stored procedure to call to fetch the data. |
System.Data.Common.DbParameterCollection | parameters | The query parameters. |
System.Threading.CancellationToken | cancellationToken | A token to cancel the asynchronous operation. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<TModel> |
Type Parameters
Name | Description |
---|---|
TModel | This is the expected return type of the query. |
TReaderResult0 | The first result set from data reader will be mapped an object or property of this type. |
TReaderResult1 | The second result set from data reader will be mapped an object or property of this type.. |
TReaderResult2 | The third result set from data reader will be mapped an object or property of this type. |
TReaderResult3 | The forth result set from data reader will be mapped an object or property of this type. |
TReaderResult4 | The fifth result set from data reader will be mapped an object or property of this type. |
TReaderResult5 | The sixth result set from data reader will be mapped an object or property of this type. |
TOutParameters | This must be either type TModel or Mapper.DummyType. If set to TModel the TModel properties will be mapped to cooresponding output parameters; if set to DummyType, the output parameters are ignored. |
QueryAsync<TModel, TReaderResult0, TReaderResult1, TReaderResult2, TReaderResult3, TReaderResult4, TReaderResult5, TReaderResult6, TOutParameters>(String, DbParameterCollection, CancellationToken)
Connect to the database and return an object of the specified type built from the corresponding data reader results and/or output parameters.
Declaration
public Task<TModel> QueryAsync<TModel, TReaderResult0, TReaderResult1, TReaderResult2, TReaderResult3, TReaderResult4, TReaderResult5, TReaderResult6, TOutParameters>(string sprocName, DbParameterCollection parameters, CancellationToken cancellationToken)
where TModel : class, new()
where TReaderResult0 : class, new()
where TReaderResult1 : class, new()
where TReaderResult2 : class, new()
where TReaderResult3 : class, new()
where TReaderResult4 : class, new()
where TReaderResult5 : class, new()
where TReaderResult6 : class, new()
where TOutParameters : class, new()
Parameters
Type | Name | Description |
---|---|---|
System.String | sprocName | The stored procedure to call to fetch the data. |
System.Data.Common.DbParameterCollection | parameters | The query parameters. |
System.Threading.CancellationToken | cancellationToken | A token to cancel the asynchronous operation. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<TModel> |
Type Parameters
Name | Description |
---|---|
TModel | This is the expected return type of the query. |
TReaderResult0 | The first result set from data reader will be mapped an object or property of this type. |
TReaderResult1 | The second result set from data reader will be mapped an object or property of this type.. |
TReaderResult2 | The third result set from data reader will be mapped an object or property of this type. |
TReaderResult3 | The forth result set from data reader will be mapped an object or property of this type. |
TReaderResult4 | The fifth result set from data reader will be mapped an object or property of this type. |
TReaderResult5 | The sixth result set from data reader will be mapped an object or property of this type. |
TReaderResult6 | The seventh result set from data reader will be mapped an object or property of this type. |
TOutParameters | This must be either type TModel or Mapper.DummyType. If set to TModel the TModel properties will be mapped to cooresponding output parameters; if set to DummyType, the output parameters are ignored. |
RunAsync(String, DbParameterCollection, CancellationToken)
Declaration
public Task RunAsync(string sprocName, DbParameterCollection parameters, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.String | sprocName | |
System.Data.Common.DbParameterCollection | parameters | |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |