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

namespace CommonHelpers {

//**************************************************************************************************
[HDbOrmType]
public abstract partial class HSPOutputBase: HPropertyNNBase {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/// <exception cref="ArgumentNullException" />
/// <exception cref="InvalidOperationException" />
/// <exception cref="InvalidCastException" />
/// <exception cref="HDatabaseException" />
[HAsyncStatic][HStrictResult][HOptionalResult]
protected static T GET<T>(SqlParameter parameter,bool treatNullAsDefaultValue=false) =>
   HSPOutputReader.GET<T>( parameter, treatNullAsDefaultValue );

/// <exception cref="HArgumentTypeException" />
/// <exception cref="ArgumentNullException" />
/// <exception cref="InvalidOperationException" />
/// <exception cref="InvalidCastException" />
/// <exception cref="HDatabaseException" />
[HAsyncStatic][HStrictResult][HOptionalResult]
protected static T VAL<T>(SqlParameter parameter,bool treatNullAsDefaultValue=false)
where T: struct =>
   HSPOutputReader.VAL<T>( parameter, treatNullAsDefaultValue );

//==================================================================================================

/// <exception cref="ArgumentNullException" />
/// <exception cref="InvalidOperationException" />
/// <exception cref="InvalidCastException" />
/// <exception cref="HDatabaseException" />
[HAsyncStatic][HStrictResult]
protected static string STR(SqlParameter parameter,bool treatNullAsEmpty=false) =>
   HSPOutputReader.STR( parameter, treatNullAsEmpty );
/// <exception cref="ArgumentNullException" />
/// <exception cref="InvalidOperationException" />
/// <exception cref="InvalidCastException" />
/// <exception cref="HDatabaseException" />
[HAsyncStatic][HStrictResult]
protected static string NS(SqlParameter parameter,bool treatNullAsEmpty=false) =>
   HSPOutputReader.NS( parameter, treatNullAsEmpty );

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

/// <exception cref="ArgumentNullException" />
/// <exception cref="InvalidOperationException" />
/// <exception cref="InvalidCastException" />
/// <exception cref="HDatabaseException" />
[HAsyncStatic][HStrictResult]
protected static int INT(SqlParameter parameter,bool treatNullAsZero=false) =>
   HSPOutputReader.INT( parameter, treatNullAsZero );
/// <exception cref="ArgumentNullException" />
/// <exception cref="InvalidOperationException" />
/// <exception cref="InvalidCastException" />
/// <exception cref="HDatabaseException" />
[HAsyncStatic][HStrictResult]
protected static long BIGINT(SqlParameter parameter,bool treatNullAsZero=false) =>
   HSPOutputReader.BIGINT( parameter, treatNullAsZero );

/// <exception cref="ArgumentNullException" />
/// <exception cref="InvalidOperationException" />
/// <exception cref="InvalidCastException" />
/// <exception cref="HDatabaseException" />
[HAsyncStatic][HStrictResult]
protected static double FP(SqlParameter parameter,bool treatNullAsZero=false) =>
   HSPOutputReader.FP( parameter, treatNullAsZero );

/// <exception cref="ArgumentNullException" />
/// <exception cref="InvalidOperationException" />
/// <exception cref="InvalidCastException" />
/// <exception cref="HDatabaseException" />
[HAsyncStatic][HStrictResult]
protected static decimal DEC(SqlParameter parameter,bool treatNullAsZero=false) =>
   HSPOutputReader.DEC( parameter, treatNullAsZero );

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

/// <exception cref="ArgumentNullException" />
/// <exception cref="InvalidOperationException" />
/// <exception cref="InvalidCastException" />
/// <exception cref="HDatabaseException" />
[HAsyncStatic][HStrictResult]
protected static bool BOOL(SqlParameter parameter,bool treatNullAsFalse=false) =>
   HSPOutputReader.BOOL( parameter, treatNullAsFalse );

/// <exception cref="ArgumentNullException" />
/// <exception cref="InvalidOperationException" />
/// <exception cref="InvalidCastException" />
/// <exception cref="HDatabaseException" />
[HAsyncStatic][HStrictResult]
protected static DateTime DT(SqlParameter parameter) =>
   HSPOutputReader.DT( parameter );
/// <exception cref="ArgumentNullException" />
/// <exception cref="InvalidOperationException" />
/// <exception cref="InvalidCastException" />
/// <exception cref="HDatabaseException" />
[HAsyncStatic][HStrictResult]
protected static DateTime UTC(SqlParameter parameter) =>
   HSPOutputReader.UTC( parameter );

/// <exception cref="ArgumentNullException" />
/// <exception cref="InvalidOperationException" />
/// <exception cref="InvalidCastException" />
/// <exception cref="HDatabaseException" />
[HAsyncStatic][HStrictResult]
protected static Guid GUID(SqlParameter parameter,bool treatNullAsEmpty=false) =>
   HSPOutputReader.GUID( parameter, treatNullAsEmpty );

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

/// <exception cref="ArgumentNullException" />
/// <exception cref="InvalidOperationException" />
/// <exception cref="InvalidCastException" />
/// <exception cref="HDatabaseException" />
[HAsyncStatic][HStrictResult]
protected static byte[] BINARY(SqlParameter parameter,bool treatNullAsEmpty=false) =>
   HSPOutputReader.BINARY( parameter, treatNullAsEmpty ) ?? new byte[0];

//--------------------------------------------------------------------------------------------------
/*
/// <exception cref="ArgumentNullException" />
/// <exception cref="InvalidOperationException" />
/// <exception cref="InvalidCastException" />
/// <exception cref="HDatabaseException" />
[HAsyncStatic][HStrictResult]
protected static ... ...(SqlParameter parameter,bool treatNullAs...=false) =>
   HSPOutputReader....( parameter, treatNullAs... );
*/
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
} // HSPOutputBase
//**************************************************************************************************

} // CommonHelpers
