Added Viewer and
change to App Setting File from Constants
This commit is contained in:
@ -1,21 +1,32 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.Filters;
|
||||
using OI.Metrology.Archive.Models;
|
||||
using OI.Metrology.Shared.Repositories;
|
||||
using OI.Metrology.Shared.ViewModels;
|
||||
using System;
|
||||
|
||||
namespace OI.Metrology.Archive.Controllers;
|
||||
|
||||
//[Authorize]
|
||||
public class PagesController : Controller
|
||||
{
|
||||
protected IMetrologyRepo _Repo;
|
||||
private readonly IMetrologyRepo _Repo;
|
||||
private readonly bool _IsTestDatabase;
|
||||
|
||||
public PagesController(IMetrologyRepo repo) => _Repo = repo;
|
||||
public PagesController(AppSettings appSettings, IMetrologyRepo repo)
|
||||
{
|
||||
_Repo = repo;
|
||||
_IsTestDatabase = appSettings.ConnectionString.Contains("test", StringComparison.InvariantCultureIgnoreCase);
|
||||
}
|
||||
|
||||
public override void OnActionExecuted(ActionExecutedContext context)
|
||||
{
|
||||
base.OnActionExecuted(context);
|
||||
ViewBag.IsTestDatabase = _IsTestDatabase;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[Route("/")]
|
||||
public IActionResult Index() =>
|
||||
//return View("Home");
|
||||
View("RunHeaders");
|
||||
|
||||
[HttpGet]
|
||||
|
Reference in New Issue
Block a user