public HomeController(ILogger <HomeController> logger, IMemoryCache memoryCache, IDefaultRepository defaultRepository, IKardSession kardSession) : base(logger, memoryCache, kardSession) { _defaultRepository = defaultRepository; }
///// <summary> ///// Creates a new instance of the ApiAuthorizedMiddleware. ///// </summary> ///// <param name="next">The next middleware in the pipeline.</param> ///// <param name="hostingEnv">The <see cref="IHostingEnvironment"/> used by this middleware.</param> ///// <param name="options">The configuration options.</param> ///// <param name="loggerFactory">An <see cref="ILoggerFactory"/> instance used to create loggers.</param> public ApiAuthorizationMiddleware(RequestDelegate next, IHostingEnvironment hostingEnv, IOptions <ApiAuthorizationOptions> options, ILoggerFactory loggerFactory, IKardSession session) { if (next == null) { throw new ArgumentNullException(nameof(next)); } if (hostingEnv == null) { throw new ArgumentNullException(nameof(hostingEnv)); } if (options == null) { throw new ArgumentNullException(nameof(options)); } if (loggerFactory == null) { throw new ArgumentNullException(nameof(loggerFactory)); } _next = next; _options = options.Value; _logger = loggerFactory.CreateLogger <ApiAuthorizationMiddleware>(); _session = session; }
public LoginAppService( IServiceProvider serviceProvider, IKardSession kardSession, IConfiguration configuration, IPasswordHasher <KuserEntity> passwordHasher, IRepositoryFactory repositoryFactory) { _kardSession = kardSession; _passwordHasher = passwordHasher; _configuration = configuration; _repositoryFactory = repositoryFactory; _defaultRepository = repositoryFactory.GetRepository <IDefaultRepository>(); _kuserRepository = repositoryFactory.GetRepository <IKuserRepository>(); //测试 //scope.Dispose()-->childProvider.Dispose()删除对Service实例的引用 using (var scope = serviceProvider.GetService <IServiceScopeFactory>().CreateScope()) { var childProvider = scope.ServiceProvider; var r1 = serviceProvider.GetService <IKuserRepository>(); var r2 = childProvider.GetService <IKuserRepository>(); bool result = (r1.GetHashCode().Equals(r2.GetHashCode())); string ee = result.ToString(); } }
public HomeController( IMemoryCache memoryCache, IRepositoryFactory repositoryFactory, IKardSession kardSession) : base(memoryCache, kardSession) { _repositoryFactory = repositoryFactory; }
public WxController( ILogger <WxController> logger, IMemoryCache memoryCache, ILoginAppService loginAppService, IKardSession kardSession, IDefaultRepository defaultRepository) : base(logger, memoryCache, kardSession) { _loginAppService = loginAppService; _defaultRepository = defaultRepository; }
public WebUserController( ILogger <WebUserController> logger, IMemoryCache memoryCache, ILoginAppService loginAppService, IKardSession kardSession) : base(logger, memoryCache, kardSession) { //HttpContext.Session.SetString("UserId", user.Id.ToString()); _loginAppService = loginAppService; }
public UserController(IHostingEnvironment env, ILogger <UserController> logger, IMemoryCache memoryCache, IDefaultRepository defaultRepository, IKardSession kardSession) : base(logger, memoryCache, kardSession) { //HttpContext.Session.SetString("UserId", user.Id.ToString()); _env = env; _defaultRepository = defaultRepository; }
public EssayController(IHostingEnvironment env, ILogger <EssayController> logger, IMemoryCache memoryCache, IDefaultRepository defaultRepository, IKardSession kardSession, IConfiguration configuration) : base(logger, memoryCache, kardSession) { _env = env; _defaultRepository = defaultRepository; _configuration = configuration; }
public CommonController(IHostingEnvironment env, IMemoryCache memoryCache, IBaiduspiderAppService baiduspiderAppService, IKardSession kardSession, IConfiguration configuration) : base(memoryCache, kardSession) { _env = env; _baiduspiderAppService = baiduspiderAppService; _configuration = configuration; }
//public LoginAppService( // UserManager<KuserEntity> userManager, // IKardSession kardSession, // IPasswordHasher<KuserEntity> passwordHasher, // IPasswordValidator<KuserEntity> passwordValidator, // IDefaultRepository defaultRepository) //{ // _userManager = userManager; // _kardSession = kardSession; // _passwordHasher = passwordHasher; // _passwordValidator = passwordValidator; // _defaultRepository = defaultRepository; //} public LoginAppService( IKardSession kardSession, IPasswordHasher <KuserEntity> passwordHasher, IDefaultRepository defaultRepository) { _kardSession = kardSession; _passwordHasher = passwordHasher; _defaultRepository = defaultRepository; }
public UserController(IHostingEnvironment env, IMemoryCache memoryCache, IRepositoryFactory repositoryFactory, IKardSession kardSession) : base(memoryCache, kardSession) { //HttpContext.Session.SetString("UserId", user.Id.ToString()); _env = env; _repositoryFactory = repositoryFactory; _defaultRepository = repositoryFactory.GetRepository <IDefaultRepository>(); }
public LoginController( IMemoryCache memoryCache, ILoginAppService loginAppService, IKardSession kardSession, IConfiguration configuration, IRepositoryFactory repositoryFactory) : base(memoryCache, kardSession) { _loginAppService = loginAppService; _configuration = configuration; _repositoryFactory = repositoryFactory; _defaultRepository = repositoryFactory.GetRepository <IDefaultRepository>(); }
public EssayController(IHostingEnvironment env, IServiceProvider serviceProvider, IRazorViewEngine razorViewEngine, ITempDataProvider tempDataProvider, IRepositoryFactory repositoryFactory, IMemoryCache memoryCache, IKardSession kardSession, IConfiguration configuration, IBaiduspiderAppService baiduspiderAppService) : base(memoryCache, kardSession) { _env = env; _serviceProvider = serviceProvider; _razorViewEngine = razorViewEngine; _tempDataProvider = tempDataProvider; _repositoryFactory = repositoryFactory; _defaultRepository = repositoryFactory.GetRepository <IDefaultRepository>(); _configuration = configuration; _baiduspiderAppService = baiduspiderAppService; }
public BaseController(IMemoryCache memoryCache = null, IKardSession kardSession = null) { _memoryCache = memoryCache; _kardSession = kardSession; }
public BaseController(ILogger <BaseController> logger, IMemoryCache memoryCache = null, IKardSession kardSession = null) { _logger = logger; _memoryCache = memoryCache; _kardSession = kardSession; }