//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// CommonHelpers satellite library | Author: Sergei Y.Kitáev
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
using System;
using System.Reflection;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Data;
using System.Data.SqlClient;

namespace CommonHelpers {

//**************************************************************************************************
partial class HDbQuery {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/// <exception cref="ArgumentNullException" />
/// <exception cref="ObjectDisposedException" />
[HAsyncStatic][HOptionalResult]
public static async Task<List<RSet_Item>?> PerformSelectN_A<RSet_Item>( SqlCommand command )
where RSet_Item: new() =>
   await HDbQueryPerformerN.Do_A<RSet_Item>(async()=>{
      return await DoReaderCommandN_A<RSet_Item>( command ); });

/// <exception cref="ArgumentNullException" />
[HAsyncStatic][HOptionalResult]
public static async Task<List<RSet_Item>?> PerformSelectN_A<RSet_Item>( string commandText )
where RSet_Item: new() =>
   await HDbQueryPerformerN.Do_A<RSet_Item>(async()=>{
      return await DoReaderCommandN_A<RSet_Item>( commandText ); });
/// <exception cref="ArgumentNullException" />
[HAsyncStatic][HOptionalResult]
public static async Task<List<RSet_Item>?> PerformSelectN_A<RSet_Item>(
   string commandText, params SqlParameter[] sqlParams )
where RSet_Item: new() =>
   await HDbQueryPerformerN.Do_A<RSet_Item>(async()=>{
      return await DoReaderCommandN_A<RSet_Item>( commandText, sqlParams ); });

//--------------------------------------------------------------------------------------------------

/// <exception cref="ArgumentNullException" />
[HAsyncStatic][HOptionalResult]
public static async Task<List<RSet_Item>?> PerformSelectFmtN_A<RSet_Item>(
   string commandTextFmt, params object?[] parameters )
where RSet_Item: new() =>
   await HDbQueryPerformerN.Do_A<RSet_Item>(async()=>{
      return await DoReaderCommandFmtN_A<RSet_Item>( commandTextFmt, parameters ); });

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
} // HDbQuery
//**************************************************************************************************

} // CommonHelpers
