General.Web/Controllers/Web/HomeController.cs
(开头部分) 4KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using General.Mvc.Models;
using General.Entities;
using General.Core;
using General.Core.Data;
using General.Entities.setting;
using Microsoft.EntityFrameworkCore;
using General.Core.UnitOfWork;
using General.Mvc.Filters;
using Consul;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using AutoMapper;
using General.Mvc.Models.Dtos;
namespace General.Mvc.Controllers.Web
{
public class HomeController : Controller
{
private readonly IRepository<setting> settingsRepository;
private readonly IRepository<setting> asettingsRepository;
private readonly GeneralDbContext generalDbContext;
private readonly IUnitOfWork unitOfWork;
private readonly IConfiguration configuration;
private readonly ILogger<HomeController> logger;
private readonly IMapper mapper;
private static int iSeed = 0;
//private IStudentsService studentsService;
//public HomeController(IStudentsService studentsService)
//{
// this.studentsService = studentsService;
//}
public HomeController( IRepository<setting> settingsRepository, IRepository<setting> asettingsRepository,GeneralDbContext generalDbContext
, IUnitOfWork unitOfWork, IConfiguration configuration,ILogger<HomeController> logger,IMapper mapper)
{
this.settingsRepository = settingsRepository;
this.asettingsRepository = asettingsRepository;
this.generalDbContext = generalDbContext;
this.unitOfWork = unitOfWork;
this.configuration = configuration;
this.logger = logger;
this.mapper = mapper ?? throw new ArgumentNullException(nameof(mapper));
}
/// <summary>
/// 主页
/// </summary>
/// <returns></returns>
[ResponseTimeFilterAttribute]
public IActionResult Index()
{
//var list = studentsService.getAll();
后面还有 87 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
