namespace IOL.GreatOffice.Api.Endpoints;
[ApiController]
public class EndpointBase : ControllerBase
{
///
/// User data for the currently logged on user.
///
protected LoggedInUserModel LoggedInUser => new() {
Username = User.FindFirstValue(AppClaims.NAME),
Id = User.FindFirstValue(AppClaims.USER_ID).AsGuid(),
};
[NonAction]
protected ActionResult KnownProblem(string title = default, string subtitle = default, Dictionary errors = default) {
return BadRequest(new KnownProblemModel {
Title = title,
Subtitle = subtitle,
Errors = errors,
TraceId = HttpContext.TraceIdentifier
});
}
}