Alle Entitäten wurden mit Attributen erstellt und zu EFCore DBContex hinzugefügt.
This commit is contained in:
@@ -2,27 +2,29 @@
|
||||
using EnvelopeGenerator.Common;
|
||||
using EnvelopeGenerator.Web.Services;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Text;
|
||||
|
||||
namespace EnvelopeGenerator.Web.Controllers
|
||||
{
|
||||
public class BaseController : Controller
|
||||
{
|
||||
internal DatabaseService database;
|
||||
internal LogConfig logConfig;
|
||||
internal State state;
|
||||
public Logger logger;
|
||||
|
||||
public BaseController(DatabaseService database, LoggingService logging)
|
||||
internal ILogger _logger;
|
||||
|
||||
public BaseController(DatabaseService database, ILogger logger)
|
||||
{
|
||||
this.database = database;
|
||||
this.logConfig = logging.LogConfig;
|
||||
this.logger = logging.LogConfig.GetLogger();
|
||||
this.state = database.State;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
internal ObjectResult ErrorResponse(Exception e)
|
||||
{
|
||||
logger.Error(e);
|
||||
// Log the detailed error message.
|
||||
_logger.LogError(e, "An unexpected error occurred.");
|
||||
|
||||
return Problem(
|
||||
statusCode: 500,
|
||||
detail: e.Message,
|
||||
|
||||
Reference in New Issue
Block a user