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

using CommonHelpers;

namespace MyFlat {

//**************************************************************************************************
partial class MvcControllerBase {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/// <exception cref="InvalidOperationException" />
[HAsyncStatic]
protected Task<ActionResult> Do_A( string methodNameOrSignature,
                                   Func<Task<ActionResult>> bodyA ) =>
   DoExplicit_A( methodNameOrSignature, bodyA );

/// <exception cref="InvalidOperationException" />
[HAsyncStatic]
protected Task<ActionResult> Do_A( Func<Task<ActionResult>> bodyA,
                                   [CallerMemberName] string? methodNameOrSignature=null ) =>
   DoExplicit_A( bodyA, methodNameOrSignature );

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

/// <exception cref="InvalidOperationException" />
/// <exception cref="HUnsuccessException" />
[HAsyncStatic]
protected Task<ActionResult<T>> Do_A<T>( string methodNameOrSignature,
                                         Func<string,T> errorResponseCreator,
                                         Func<Task<ActionResult<T>>> bodyA )
where T: class =>
   DoExplicit_A<T>( methodNameOrSignature, errorResponseCreator, bodyA );

/// <exception cref="InvalidOperationException" />
/// <exception cref="HUnsuccessException" />
[HAsyncStatic]
protected Task<ActionResult<T>> Do_A<T>( Func<string,T> errorResponseCreator,
                                         Func<Task<ActionResult<T>>> bodyA,
                                         [CallerMemberName]
                                         string? methodNameOrSignature=null )
where T: class =>
   DoExplicit_A<T>( errorResponseCreator, bodyA, methodNameOrSignature );

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
} // MvcControllerBase
//**************************************************************************************************

} // MyFlat
