blob: de5d967b841252559871721e4c526970e8a3553e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
namespace IOL.GreatOffice.Api.Endpoints;
[ApiController]
public class EndpointBase : ControllerBase
{
/// <summary>
/// User data for the currently logged on user.
/// </summary>
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<string, string> errors = default) {
return BadRequest(new KnownProblemModel {
Title = title,
Subtitle = subtitle,
Errors = errors,
TraceId = HttpContext.TraceIdentifier
});
}
}
|