Home index
This commit is contained in:
@ -6,6 +6,10 @@ using System.Linq;
|
||||
using isnd.ViewModels;
|
||||
using System.Reflection;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Build.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
using isnd.Entities;
|
||||
using isn.abst;
|
||||
|
||||
namespace isnd.Controllers
|
||||
{
|
||||
@ -15,14 +19,18 @@ namespace isnd.Controllers
|
||||
public class HomeController : Controller
|
||||
{
|
||||
private readonly ApplicationDbContext _dbContext;
|
||||
private readonly IsndSettings _isndSettings;
|
||||
|
||||
/// <summary>
|
||||
/// Home controller ctor
|
||||
/// </summary>
|
||||
/// <param name="dbContext"></param>
|
||||
/// <param name="isndSettings"></param>
|
||||
public HomeController(
|
||||
ApplicationDbContext dbContext)
|
||||
ApplicationDbContext dbContext, IOptions<IsndSettings> isndSettings)
|
||||
{
|
||||
_dbContext = dbContext;
|
||||
_isndSettings = isndSettings.Value;
|
||||
}
|
||||
|
||||
public IActionResult Index()
|
||||
@ -30,7 +38,8 @@ namespace isnd.Controllers
|
||||
return View(new HomeIndexViewModel{
|
||||
PkgCount = _dbContext.Packages
|
||||
.Where(p => p.Versions.Count > 0)
|
||||
.Count()});
|
||||
.Count(),
|
||||
APIUrl = _isndSettings.ExternalUrl + Constants.ApiVersionPrefix + ApiConfig.Index});
|
||||
}
|
||||
|
||||
public IActionResult About()
|
||||
|
Reference in New Issue
Block a user