System.Data.Common.DbConnection.QueryFirstOrDefaultAsync(string, dynamic, int, System.Data.IDbTransaction, string, int, string)

Here are the examples of the csharp api class System.Data.Common.DbConnection.QueryFirstOrDefaultAsync(string, dynamic, int, System.Data.IDbTransaction, string, int, string) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Example 7

1. Example

Project: Opserver
Source File: ExtensionMethods.Sql.cs
View license
public static async Task<T> QueryFirstOrDefaultAsync<T>(this DbConnection conn, string sql, dynamic param = null, int? commandTimeout = null, IDbTransaction transaction = null, [CallerFilePath]string fromFile = null, [CallerLineNumber]int onLine = 0, string comment = null)
        {
            using (await conn.EnsureOpenAsync().ConfigureAwait(false))
            {
                return await conn.QueryFirstOrDefaultAsync<T>(MarkSqlString(sql, fromFile, onLine, comment), param as object, transaction, commandTimeout).ConfigureAwait(false);
            }
        }