autobus-api_old/AutobusApi.Api/Controllers/BaseController.cs

12 lines
288 B
C#

using MediatR;
using Microsoft.AspNetCore.Mvc;
namespace AutobusApi.Api.Controllers;
[ApiController]
public class BaseController : ControllerBase
{
private IMediator _mediator;
protected IMediator Mediator => _mediator ??= HttpContext.RequestServices.GetService<IMediator>();
}