public UserController( UserManager <ApplicationUser> userManager, IHttpContextAccessor httpContextAccessor, MardisContext mardisContext, ILogger <UserController> logger, IDataProtectionProvider protectorProvider, IMemoryCache memoryCache, RedisCache distributedCache) : base(userManager, httpContextAccessor, mardisContext, logger) { _protector = protectorProvider.CreateProtector(GetType().FullName); _userBusiness = new UserBusiness(mardisContext); _typeUserBusiness = new TypeUserBusiness(mardisContext, distributedCache); TableName = "MardisSecurity.[User]"; }
public TaskCampaignBusiness(MardisContext mardisContext, RedisCache distributedCache) : base(mardisContext) { _taskCampaignDao = new TaskCampaignDao(mardisContext); _questionDetailDao = new QuestionDetailDao(mardisContext); _statusTaskBusiness = new StatusTaskBusiness(mardisContext, distributedCache); _sequenceBusiness = new SequenceBusiness(mardisContext); _campaignServicesDao = new CampaignServicesDao(mardisContext); _branchDao = new BranchDao(mardisContext); _answerDao = new AnswerDao(mardisContext); _answerDetailDao = new AnswerDetailDao(mardisContext); _branchImageBusiness = new BranchImageBusiness(mardisContext); _userDao = new UserDao(mardisContext); _campaignDao = new CampaignDao(mardisContext); _serviceDetailTaskBusiness = new ServiceDetailTaskBusiness(mardisContext); _personDao = new PersonDao(mardisContext); _profileDao = new ProfileDao(mardisContext); _typeUserBusiness = new TypeUserBusiness(mardisContext, distributedCache); _serviceDetailDao = new ServiceDetailDao(mardisContext); _questionDao = new QuestionDao(mardisContext); _redisCache = distributedCache; _serviceDetailBusiness = new ServiceDetailBusiness(mardisContext); Mapper.Initialize(cfg => { cfg.CreateMap <Service, MyTaskServicesViewModel>() .ForMember(dest => dest.ServiceDetailCollection, opt => opt.MapFrom(src => src.ServiceDetails.OrderBy(sd => sd.Order))); cfg.CreateMap <ServiceDetail, MyTaskServicesDetailViewModel>() .ForMember(dest => dest.QuestionCollection, opt => opt.MapFrom(src => src.Questions.OrderBy(q => q.Order))) .ForMember(dest => dest.Sections, opt => opt.MapFrom(src => src.Sections.OrderBy(s => s.Order))); cfg.CreateMap <Question, MyTaskQuestionsViewModel>() .ForMember(dest => dest.HasPhoto, opt => opt.MapFrom(src => src.HasPhoto.IndexOf("S", StringComparison.Ordinal) >= 0)) .ForMember(dest => dest.QuestionDetailCollection, opt => opt.MapFrom(src => src.QuestionDetails.OrderBy(qd => qd.Order))) .ForMember(dest => dest.CodeTypePoll, opt => opt.MapFrom(src => src.TypePoll.Code)); cfg.CreateMap <QuestionDetail, MyTaskQuestionDetailsViewModel>(); }); }