using System;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;

using CommonHelpers;

namespace MyFlat {

//**************************************************************************************************
partial class GeneralApiResponseController {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/// <exception cref="InvalidOperationException" />
[HAsyncStatic]
protected Task<dynamic> Do_A( ApiArgumentsBase? args,
                              Func<Task<GeneralApiResponse>> bodyA,
                              [CallerMemberName][HRequired] string? methodNameOrSignature=null )
{
   ApplyQueryArgsToContext( args );
   return DoAuto_A<GeneralApiResponse>(
      CreateErrorResponseCallback, bodyA, methodNameOrSignature );
}

/// <exception cref="InvalidOperationException" />
[HAsyncStatic]
protected Task<dynamic> DoDynamic_A( ApiArgumentsBase? args,
                                     Func<Task<dynamic>> bodyA,
                                     [CallerMemberName][HRequired]
                                     string? methodNameOrSignature=null )
{
   ApplyQueryArgsToContext( args );
   return base.DoDynamic_A<dynamic>( CreateErrorResponseCallback, bodyA, methodNameOrSignature );
}

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

/// <exception cref="InvalidOperationException" />
[HAsyncStatic]
protected Task<ActionResult<GeneralApiResponse>> DoExplicit_A(
   ApiArgumentsBase? args,
   Func<Task<ActionResult<GeneralApiResponse>>> bodyA,
   [CallerMemberName][HRequired] string? methodNameOrSignature=null )
{
   ApplyQueryArgsToContext( args );
   return base.DoExplicit_A<GeneralApiResponse>( CreateErrorResponseCallback,
      bodyA, methodNameOrSignature );
}

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

/// <exception cref="InvalidOperationException" />
[HAsyncStatic]
protected Task<dynamic> Do_A( string methodNameOrSignature,
                              ApiArgumentsBase? args, Func<Task<GeneralApiResponse>> bodyA )
{
   ApplyQueryArgsToContext( args );
   return DoAuto_A<GeneralApiResponse>( methodNameOrSignature, CreateErrorResponseCallback, bodyA );
}

/// <exception cref="InvalidOperationException" />
[HAsyncStatic]
protected Task<dynamic> DoDynamic_A( string methodNameOrSignature,
                                     ApiArgumentsBase? args, Func<Task<dynamic>> bodyA )
{
   ApplyQueryArgsToContext( args );
   return base.DoDynamic_A<dynamic>( methodNameOrSignature, CreateErrorResponseCallback, bodyA );
}

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

/// <exception cref="InvalidOperationException" />
[HAsyncStatic]
protected Task<ActionResult<GeneralApiResponse>> DoExplicit_A(
   string methodNameOrSignature,
   ApiArgumentsBase? args, Func<Task<ActionResult<GeneralApiResponse>>> bodyA )
{
   ApplyQueryArgsToContext( args );
   return base.DoExplicit_A<GeneralApiResponse>( methodNameOrSignature,
      CreateErrorResponseCallback, bodyA );
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
} // GeneralApiResponseController
//**************************************************************************************************

} // MyFlat
