You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
iot/projects/UserCenter/Controllers/HomeController.cs

39 lines
1.4 KiB

using Application.Domain.Entities;
using Application.Models;
using Infrastructure.Data;
using Infrastructure.Extensions;
using Infrastructure.Security;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Localization;
using Newtonsoft.Json;
using System.Linq;
namespace UserCenter.Controllers
{
public class HomeController : Controller
{
private readonly IRepository<User> _userRepo;
private readonly IRepository<Site> _siteRepo;
private readonly IConfiguration _configuration;
private readonly IEncryptionService _encryptionService;
public HomeController(IRepository<User> userRepo, IRepository<Site> siteRepo, IEncryptionService encryptionService, IConfiguration configuration)
{
this._userRepo = userRepo;
this._siteRepo = siteRepo;
this._encryptionService = encryptionService;
this._configuration = configuration;
}
public IActionResult Index()
{
//var modelMetadata = this.GetModelMetadata<RegisterModel>();
//var json = JsonConvert.SerializeObject(modelMetadata, new JsonSerializerSettings
//{
// ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
//});
return View(this._siteRepo.ReadOnlyTable().ToList());
}
}
}