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

using CommonHelpers;

namespace MyFlat {

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

/// <exception cref="InvalidOperationException" />
[HAsyncStatic]
protected ActionResult Do( string methodNameOrSignature, Func<ActionResult> body ) =>
   DoExplicit( methodNameOrSignature, body );

/// <exception cref="InvalidOperationException" />
[HAsyncStatic]
protected ActionResult Do( Func<ActionResult> body,
                           [CallerMemberName] string? methodNameOrSignature=null ) =>
   DoExplicit( body, methodNameOrSignature );

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

/// <exception cref="InvalidOperationException" />
/// <exception cref="HUnsuccessException" />
[HAsyncStatic]
protected ActionResult<T> Do<T>( string methodNameOrSignature,
                                 Func<string,T> errorResponseCreator,
                                 Func<ActionResult<T>> body )
where T: class =>
   DoExplicit<T>( methodNameOrSignature, errorResponseCreator, body );

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

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

} // MyFlat
