2021-06-22 00:10:01 +01:00
|
|
|
|
using Microsoft.AspNetCore.Hosting;
|
2021-04-08 02:03:17 +01:00
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
2021-04-11 22:39:26 +01:00
|
|
|
|
using Microsoft.Extensions.Logging;
|
2021-08-15 19:09:01 +01:00
|
|
|
|
using isnd.Data;
|
2021-06-22 00:10:01 +01:00
|
|
|
|
using System.Linq;
|
2021-08-15 19:09:01 +01:00
|
|
|
|
using isnd.ViewModels;
|
2021-07-05 12:55:52 +01:00
|
|
|
|
using Unleash;
|
2022-04-17 20:36:28 +01:00
|
|
|
|
using System.Reflection;
|
2022-07-03 14:50:57 +01:00
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
2021-04-08 02:03:17 +01:00
|
|
|
|
|
2021-08-15 19:09:01 +01:00
|
|
|
|
namespace isnd.Controllers
|
2021-04-08 02:03:17 +01:00
|
|
|
|
{
|
|
|
|
|
|
public class HomeController : Controller
|
|
|
|
|
|
{
|
2021-07-11 18:08:49 +01:00
|
|
|
|
private readonly ApplicationDbContext _dbContext;
|
|
|
|
|
|
private readonly IUnleash _unleashĈlient;
|
2021-06-22 00:10:01 +01:00
|
|
|
|
|
2021-04-25 12:12:50 +01:00
|
|
|
|
public HomeController(
|
2021-06-22 00:10:01 +01:00
|
|
|
|
ApplicationDbContext dbContext,
|
2021-08-28 18:41:22 +01:00
|
|
|
|
IUnleash unleashĈlient)
|
2021-04-11 22:39:26 +01:00
|
|
|
|
{
|
2021-06-22 00:10:01 +01:00
|
|
|
|
_dbContext = dbContext;
|
2021-07-11 22:13:48 +01:00
|
|
|
|
_unleashĈlient = unleashĈlient;
|
2021-04-11 22:39:26 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2021-04-08 02:03:17 +01:00
|
|
|
|
public IActionResult Index()
|
|
|
|
|
|
{
|
2021-06-22 00:10:01 +01:00
|
|
|
|
return View(new HomeIndexViewModel{
|
2022-07-03 14:50:57 +01:00
|
|
|
|
PkgCount = _dbContext.Packages
|
|
|
|
|
|
.Where(p => p.Versions.Count > 0)
|
|
|
|
|
|
.Count(),
|
2021-07-11 18:08:49 +01:00
|
|
|
|
UnleashClient = _unleashĈlient
|
2021-06-22 00:10:01 +01:00
|
|
|
|
});
|
2021-04-08 02:03:17 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public IActionResult About()
|
|
|
|
|
|
{
|
|
|
|
|
|
ViewData["Message"] = "Your application description page.";
|
|
|
|
|
|
|
|
|
|
|
|
return View();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public IActionResult Contact()
|
|
|
|
|
|
{
|
|
|
|
|
|
ViewData["Message"] = "Your contact page.";
|
2022-04-17 20:36:28 +01:00
|
|
|
|
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));
|
2021-04-08 02:03:17 +01:00
|
|
|
|
|
|
|
|
|
|
return View();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-04-25 12:12:50 +01:00
|
|
|
|
public IActionResult Privacy()
|
2021-04-08 02:03:17 +01:00
|
|
|
|
{
|
2021-04-25 12:12:50 +01:00
|
|
|
|
ViewData["Message"] = "Your Privacy page.";
|
2021-04-08 02:03:17 +01:00
|
|
|
|
|
2021-06-21 23:38:05 +01:00
|
|
|
|
return View(ViewData);
|
2021-04-08 02:03:17 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2021-05-23 01:00:57 +01:00
|
|
|
|
public IActionResult Error()
|
|
|
|
|
|
{
|
|
|
|
|
|
return View();
|
|
|
|
|
|
}
|
2021-04-08 02:03:17 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2022-04-17 20:36:28 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|