Exemple #1
0
        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();
            }
        }
Exemple #2
0
 public HomeController(ILogger <HomeController> logger,
                       IMemoryCache memoryCache,
                       IDefaultRepository defaultRepository,
                       IKardSession kardSession) : base(logger, memoryCache, kardSession)
 {
     _defaultRepository = defaultRepository;
 }
Exemple #3
0
 public PunchCardController(IMemberRepository memberRepository,
                            IPunchCardRepository punchCardRepository, IDefaultRepository defaultRepository)
 {
     _memberRepository    = memberRepository;
     _punchCardRepository = punchCardRepository;
     _defaultRepository   = defaultRepository;
 }
 public QuestionsService(IDefaultRepository <Question> questionRepository, IDefaultRepository <Option> optionRepository,
                         DefaultContext context)
 {
     _questionRepository = questionRepository;
     _optionRepository   = optionRepository;
     _context            = context;
 }
Exemple #5
0
 public AccountService(IDefaultRepository <Account> accountRepository, IDefaultRepository <Student> studentRepository, IDefaultRepository <Log> logRepository, IDefaultRepository <Teacher> teacherRepository, IDefaultRepository <Message> messageRepository)
 {
     _accountRepository = accountRepository;
     _studentRepository = studentRepository;
     _logRepository     = logRepository;
     _teacherRepository = teacherRepository;
     _messageRepository = messageRepository;
 }
Exemple #6
0
 public StudentService(IDefaultRepository <Facultative> facultativeRepository
                       , IDefaultRepository <Student> studentRepository
                       , IDefaultRepository <Log> logRepository
                       , IDefaultRepository <Account> accountRepository)
 {
     _facultativeRepository = facultativeRepository;
     _studentRepository     = studentRepository;
     _logRepository         = logRepository;
 }
Exemple #7
0
 public AttendanceController(IPracticeRepository practiceRepository, IDefaultRepository defaultRepository,
                             IMemberRepository memberRepository, IAttendanceRepository attendanceRepository,
                             IPunchCardRepository punchCardRepository)
 {
     _practiceRepository   = practiceRepository;
     _defaultRepository    = defaultRepository;
     _memberRepository     = memberRepository;
     _attendanceRepository = attendanceRepository;
     _punchCardRepository  = punchCardRepository;
 }
Exemple #8
0
 public WxController(
     ILogger <WxController> logger,
     IMemoryCache memoryCache,
     ILoginAppService loginAppService,
     IKardSession kardSession,
     IDefaultRepository defaultRepository) : base(logger, memoryCache, kardSession)
 {
     _loginAppService   = loginAppService;
     _defaultRepository = defaultRepository;
 }
Exemple #9
0
 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;
 }
Exemple #10
0
 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;
 }
Exemple #11
0
        //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;
        }
Exemple #12
0
        public AuthService(IOptions <AuthSettings> authSettings, IJwtFactory jwtFactory, ITokenFactory tokenFactory, IJwtTokenValidator jwtTokenValidator,
                           IDefaultRepository <RefreshToken> refreshTokenRepository, IDefaultRepository <OAuth> oAuthRepository)
        {
            _authSettings = authSettings.Value;

            _jwtFactory        = jwtFactory;
            _tokenFactory      = tokenFactory;
            _jwtTokenValidator = jwtTokenValidator;

            _refreshTokenRepository = refreshTokenRepository;
            _oAuthRepository        = oAuthRepository;
        }
Exemple #13
0
 public TeacherService(IDefaultRepository <Facultative> facultativeRepository
                       , IDefaultRepository <Teacher> teacherRepository
                       , IDefaultRepository <Report> reportRepository
                       , IDefaultRepository <ReportBook> reportBookRepository
                       , IDefaultRepository <Log> logRepository)
 {
     _facultativeRepository = facultativeRepository;
     _teacherRepository     = teacherRepository;
     _reportRepository      = reportRepository;
     _reportBookRepository  = reportBookRepository;
     _logRepository         = logRepository;
 }
Exemple #14
0
        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>();
        }
Exemple #15
0
 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>();
 }
Exemple #16
0
 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;
 }
Exemple #17
0
 public MessagesService(IDefaultRepository <Message> messageRepository)
 {
     this._messageRepository = messageRepository;
 }
Exemple #18
0
 public CoverRepository(IDefaultRepository defaultRepository)
 {
     _defaultRepository = defaultRepository;
 }
Exemple #19
0
 public EssayLikeRepository(IDefaultRepository defaultRepository)
 {
     _defaultRepository = defaultRepository;
 }
Exemple #20
0
 public ManualsService(IDefaultRepository <Manual> manualRepository, IDefaultRepository <Feature> featureRepository)
 {
     _manualRepository  = manualRepository;
     _featureRepository = featureRepository;
 }
Exemple #21
0
 public KuserRepository(IDefaultRepository defaultRepository)
 {
     _defaultRepository = defaultRepository;
 }
Exemple #22
0
 public LongTaskRepository(IDefaultRepository defaultRepository, ILogger <LongTaskRepository> logger)
 {
     _defaultRepository = defaultRepository;
     _logger            = logger;
 }
Exemple #23
0
 public TableDefaultService(IDefaultRepository repository, IMapper mapper) : base(repository, mapper)
 {
 }
Exemple #24
0
 public ResolvesService(IDefaultRepository <Resolve> resolveRepository)
 {
     this._resolveRepository = resolveRepository;
 }
Exemple #25
0
 public ArticlesService(IDefaultRepository <Article> articleRepository)
 {
     _articleRepository = articleRepository;
 }
Exemple #26
0
 public AttachmentsService(IDefaultRepository <UploadFile> uploadFileRepository)
 {
     this._uploadFileRepository = uploadFileRepository;
 }
Exemple #27
0
 public SubscribesService(IDefaultRepository <Subscribe> subscribeRepository)
 {
     this._subscribeRepository = subscribeRepository;
 }
Exemple #28
0
 public ExamsService(IDefaultRepository <Exam> examRepository, IDefaultRepository <ExamQuestion> examQuestionRepository)
 {
     _examRepository         = examRepository;
     _examQuestionRepository = examQuestionRepository;
 }
Exemple #29
0
 public NotesService(IDefaultRepository <Note> noteRepository)
 {
     this._noteRepository = noteRepository;
 }
Exemple #30
0
 public PaysService(IDefaultRepository <Pay> payRepository, IDefaultRepository <PayWay> payWayRepository)
 {
     this._payRepository    = payRepository;
     this._payWayRepository = payWayRepository;
 }