/// <summary> /// Executes the query, and returns the first column of the first row in the result /// set returned by the query. Additional columns or rows are ignored. /// </summary> /// <param name="db"></param> /// <param name="sprocName">Name of the stored procedure to call.</param> /// <param name="parameters">An object that contains the properties to add as SQL parameters to the SQL command.</param> /// <param name="dflt"></param> /// <returns></returns> public static async Task <object> ExecuteScalarAsync(this BaDatabase db, string sprocName, object parameters = null, object dflt = null) { var cmd = db.PrepareSprocCmd(sprocName, parameters); return(await db.ExecuteScalarAsync(cmd, dflt).ConfigureAwait(false)); }