No release yet
This commit is contained in:
78
src/isnd/Controllers/HomeController.cs
Normal file
78
src/isnd/Controllers/HomeController.cs
Normal file
@ -0,0 +1,78 @@
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using isnd.Data;
|
||||
using System.Linq;
|
||||
using isnd.ViewModels;
|
||||
using Unleash;
|
||||
using System.Reflection;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace isnd.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// Home Controller
|
||||
/// </summary>
|
||||
public class HomeController : Controller
|
||||
{
|
||||
private readonly ApplicationDbContext _dbContext;
|
||||
private readonly IUnleash _unleashĈlient;
|
||||
/// <summary>
|
||||
/// Home controller ctor
|
||||
/// </summary>
|
||||
/// <param name="dbContext"></param>
|
||||
/// <param name="unleashĈlient"></param>
|
||||
|
||||
public HomeController(
|
||||
ApplicationDbContext dbContext,
|
||||
IUnleash unleashĈlient)
|
||||
{
|
||||
_dbContext = dbContext;
|
||||
_unleashĈlient = unleashĈlient;
|
||||
}
|
||||
|
||||
public IActionResult Index()
|
||||
{
|
||||
return View(new HomeIndexViewModel{
|
||||
PkgCount = _dbContext.Packages
|
||||
.Where(p => p.Versions.Count > 0)
|
||||
.Count(),
|
||||
UnleashClient = _unleashĈlient
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult About()
|
||||
{
|
||||
ViewData["Message"] = "Your application description page.";
|
||||
|
||||
return View();
|
||||
}
|
||||
|
||||
public IActionResult Contact()
|
||||
{
|
||||
ViewData["Message"] = "Your contact page.";
|
||||
var ass = typeof(isn.Abstract.Resource).GetType().Assembly;
|
||||
var attrs = ass.GetCustomAttributes(true);
|
||||
// ass.GetCustomAttributes(true);
|
||||
System.Reflection.AssemblyFileVersionAttribute v = (AssemblyFileVersionAttribute)
|
||||
GetType().Assembly.GetCustomAttribute(typeof(AssemblyFileVersionAttribute));
|
||||
|
||||
return View();
|
||||
}
|
||||
|
||||
public IActionResult Privacy()
|
||||
{
|
||||
ViewData["Message"] = "Your Privacy page.";
|
||||
|
||||
return View(ViewData);
|
||||
}
|
||||
|
||||
public IActionResult Error()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user