Remove Blazor
This commit is contained in:
30
EnvelopeGenerator.Web/Controllers/BaseController.cs
Normal file
30
EnvelopeGenerator.Web/Controllers/BaseController.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using DigitalData.Modules.Logging;
|
||||
using EnvelopeGenerator.Web.Services;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using static EnvelopeGenerator.Web.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Web.Controllers
|
||||
{
|
||||
public class BaseController : Controller
|
||||
{
|
||||
internal DatabaseService database;
|
||||
internal LogConfig logConfig;
|
||||
internal Logger logger;
|
||||
|
||||
public BaseController(DatabaseService database, LoggingService logging)
|
||||
{
|
||||
this.database = database;
|
||||
this.logConfig = logging.LogConfig;
|
||||
this.logger = logging.LogConfig.GetLoggerFor(GetType().Name);
|
||||
}
|
||||
|
||||
internal ObjectResult ErrorResponse(Exception e)
|
||||
{
|
||||
logger.Error(e);
|
||||
return Problem(
|
||||
statusCode: 500,
|
||||
detail: e.Message,
|
||||
type: ErrorType.ServerError.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user