25 lines
803 B
C#
25 lines
803 B
C#
using SiteManagementSystem_SoftwareEngineering_.Model;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace SiteManagementSystem_SoftwareEngineering_.Extension
|
|
{
|
|
public static class ControllerBaseExtension
|
|
{
|
|
public static IActionResult Success(
|
|
this ControllerBase controller,
|
|
string msg = "",
|
|
object? data = null
|
|
) => ApiResponse.Success(msg, data);
|
|
public static IActionResult Forbidden(
|
|
this ControllerBase controller,
|
|
string msg = "",
|
|
object? data = null
|
|
)=> ApiResponse.Forbidden(msg, data);
|
|
public static IActionResult Fail(
|
|
this ControllerBase controller,
|
|
string msg = "",
|
|
object? data = null
|
|
) => ApiResponse.Fail(msg, data);
|
|
}
|
|
}
|