Exemplo n.º 1
0
 public ExecuteCommandLocally(IIncomingCommandQueueRepository incomingCommandQueueRepository,IResolveCommand resolveCommand, IErrorLogRepository errorLogService)
 {
     _resolveCommand = resolveCommand;
     //_logToServer = logToServer;
     _errorLogService = errorLogService;
     _incomingCommandQueueRepository = incomingCommandQueueRepository;
 }
 public AccountController(ICustomerRepository customerRepo, IStringLocalizer <AccountController> localizer, IErrorLogRepository errorRepo, IMapper mapper)
 {
     _customerRepo = customerRepo;
     _localizer    = localizer;
     _errorRepo    = errorRepo;
     _mapper       = mapper;
 }
Exemplo n.º 3
0
 public ProductService()
     : base(new ProductRepository())
 {
     _productRepository = new ProductRepository();
     _productLocation   = new ProductLocationRepository();
     _logger            = new ErrorLogRepository();
 }
Exemplo n.º 4
0
 public ErrorLogAppService(
     IErrorLogRepository errorLogRepository,
     IUnitOfWork unitOfWork)
 {
     _errorLogRepository = errorLogRepository;
     _unitOfWork         = unitOfWork;
 }
Exemplo n.º 5
0
 public ErrorLogService(
     IErrorLogRepository errorLogRepository,
     IUnitOfWork unitOfWork)
 {
     this.errorLogRepository = errorLogRepository;
     this.unitOfWork         = unitOfWork;
 }
Exemplo n.º 6
0
 public MessageController(IMessageRepository messageRepository, IUserRepository userRepository, IErrorLogRepository errorLogRepository, IBlackListRepository blackListRepository)
 {
     _messageRepository   = messageRepository;
     _userRepository      = userRepository;
     _errorLogRepository  = errorLogRepository;
     _blackListRepository = blackListRepository;
 }
Exemplo n.º 7
0
 public ErrorLogsControllerTest()
 {
     _errorLogRepository = new ErrorLogRepositoryMock();
     _data = new LogDetails {
         EIN = "22-1234567", Exception = "My Test Exception 22", Level = "INFO", Message = "This a test message", User = "******", UserId = "123456"
     };
 }
 public CategorySidebar(ITopCategoryRepository topCategoryRepo, IMiddleCategoryRepository middleCategoryRepo, ISubCategoryRepository subCategoryRepo, IErrorLogRepository errorRepo)
 {
     _topCategoryRepo    = topCategoryRepo;
     _middleCategoryRepo = middleCategoryRepo;
     _subCategoryRepo    = subCategoryRepo;
     _errorRepo          = errorRepo;
 }
Exemplo n.º 9
0
 public IndexController(IWxManager wxManager, IWxAccountRepository wxAccountRepository, IWxChatRepository wxChatRepository, IErrorLogRepository errorLogRepository)
 {
     _wxManager           = wxManager;
     _wxAccountRepository = wxAccountRepository;
     _wxChatRepository    = wxChatRepository;
     _errorLogRepository  = errorLogRepository;
 }
Exemplo n.º 10
0
 public SiteLogRepository(ISettingsManager settingsManager, IConfigRepository configRepository, IAdministratorRepository administratorRepository, ILogRepository logRepository, IErrorLogRepository errorLogRepository)
 {
     _repository              = new Repository <SiteLog>(settingsManager.Database, settingsManager.Redis);
     _configRepository        = configRepository;
     _administratorRepository = administratorRepository;
     _logRepository           = logRepository;
     _errorLogRepository      = errorLogRepository;
 }
 public AdsProductComponent(IAdProductRepository adproRepo, IMapper mapper, IErrorLogRepository errorRepo, IStringLocalizer <AdsProductComponent> localizer, IHttpContextAccessor accesor)
 {
     _adproRepo = adproRepo;
     _mapper    = mapper;
     _errorRepo = errorRepo;
     _localizer = localizer;
     _accesor   = accesor;
 }
Exemplo n.º 12
0
 public LogRepository(ISettingsManager settingsManager, IConfigRepository configRepository, IAdministratorRepository administratorRepository, IUserRepository userRepository, IErrorLogRepository errorLogRepository)
 {
     _repository              = new Repository <Log>(settingsManager.Database, settingsManager.Redis);
     _configRepository        = configRepository;
     _administratorRepository = administratorRepository;
     _userRepository          = userRepository;
     _errorLogRepository      = errorLogRepository;
 }
Exemplo n.º 13
0
		public ReportPresenter(IReportView view, IErrorLogRepository repository, IReportGenerator generator, ISettingsManager settingsManager)
		{
			View = view;
			_repository = repository;
			_generator = generator;
			_settingsManager = settingsManager;

			RegisterEvents();
		}
 public ReceiveAndProcessPendingRemoteCommandsService(IWebApiProxy webApiProxy, IConfigRepository configRepository, 
     IErrorLogRepository errorLogRepository, IAuditLogWFManager auditLogWFManager,  IIncomingCommandHandler incomingCommandHandler, IIncomingCommandQueueRepository incomingCommandQueueRepository)
 {
     _incomingCommandHandler = incomingCommandHandler;
     _incomingCommandQueueRepository = incomingCommandQueueRepository;
     _auditLogWFManager = auditLogWFManager;
     _errorLogRepository = errorLogRepository;
     _configRepository = configRepository;
     _webApiProxy = webApiProxy;
 }
Exemplo n.º 15
0
		public SearchPresenter(ISearchView view, IErrorLogRepository errorLogRepository, IHttpUserAgentSearchLauncherFactory httpUserAgentSearchLauncherFactory, ISettingsManager settingsManager)
		{
			View = view;

			_repository = errorLogRepository;
			_httpUserAgentSearchLauncherFactory = httpUserAgentSearchLauncherFactory;
			_settingsManager = settingsManager;

			RegisterEvents();
		}
Exemplo n.º 16
0
 public ContentRepository(ISettingsManager settingsManager, IAdministratorRepository administratorRepository, IChannelRepository channelRepository, ISiteRepository siteRepository, IErrorLogRepository errorLogRepository, IStatRepository statRepository)
 {
     _settingsManager         = settingsManager;
     _administratorRepository = administratorRepository;
     _channelRepository       = channelRepository;
     _siteRepository          = siteRepository;
     _errorLogRepository      = errorLogRepository;
     _statRepository          = statRepository;
     _repository = new Repository <Content>(settingsManager.Database, settingsManager.Redis);
 }
Exemplo n.º 17
0
 public ContentsLayerWordController(IAuthManager authManager, IPathManager pathManager, ICreateManager createManager, ISiteRepository siteRepository, IChannelRepository channelRepository, IContentRepository contentRepository, IErrorLogRepository errorLogRepository)
 {
     _authManager        = authManager;
     _pathManager        = pathManager;
     _createManager      = createManager;
     _siteRepository     = siteRepository;
     _channelRepository  = channelRepository;
     _contentRepository  = contentRepository;
     _errorLogRepository = errorLogRepository;
 }
Exemplo n.º 18
0
 public SerchBoxController(ITopCategoryRepository topRepo, IProductRepository productRepo, IErrorLogRepository errorRepo, IHttpContextAccessor httpContextAccessor, IMiddleCategoryRepository midRepo, ISubCategoryRepository subRepo, IBrandRepository brandRepo)
 {
     _topRepo             = topRepo;
     _productRepo         = productRepo;
     _errorRepo           = errorRepo;
     _httpContextAccessor = httpContextAccessor;
     _midRepo             = midRepo;
     _subRepo             = subRepo;
     _brandRepo           = brandRepo;
 }
Exemplo n.º 19
0
 public BrandController(ITopCategoryRepository topRepo, IProductRepository productRepo, IErrorLogRepository errorRepo, IHttpContextAccessor httpContextAccessor, IMiddleCategoryRepository midRepo, ISubCategoryRepository subRepo, IStringLocalizer <ProductController> localizer, IBrandRepository brandRepo)
 {
     _topRepo             = topRepo;
     _productRepo         = productRepo;
     _errorRepo           = errorRepo;
     _httpContextAccessor = httpContextAccessor;
     _midRepo             = midRepo;
     _subRepo             = subRepo;
     _localizer           = localizer;
     _brandRepo           = brandRepo;
 }
Exemplo n.º 20
0
 public LoggerService(IErrorLogRepository ErrorLogRepository, ILogErrorEmailer LogErrorEmailer)
 {
     if (ErrorLogRepository == null) {
         throw new ArgumentNullException("ErrorLogRepository");
     }
     if (LogErrorEmailer == null) {
         throw new ArgumentNullException("LogErrorEmailer");
     }
     this.errorLogRepository = ErrorLogRepository;
     this.logErrorEmailer = LogErrorEmailer;
 }
Exemplo n.º 21
0
 public LogMongoUnitOfWork(
     LogMongoContext logMongoContext,
     IErrorLogRepository errorLogRepository,
     IDebugLogRepository debugLogRepository,
     IAuditLogRepository auditLogRepository)
 {
     _logMongoContext    = logMongoContext;
     _errorLogRepository = errorLogRepository;
     _debugLogRepository = debugLogRepository;
     _auditLogRepository = auditLogRepository;
 }
Exemplo n.º 22
0
 public ErrorLogController( IErrorLogRepository ErrorLogRepository, IUserRepository UserRepository )
 {
     if ( ErrorLogRepository == null ) {
         throw new ArgumentNullException( "ErrorLogRepository" );
     }
     if (UserRepository == null) {
         throw new ArgumentNullException("UserRepository");
     }
     this.errorLogRepository = ErrorLogRepository;
     this.userRepository = UserRepository;
 }
Exemplo n.º 23
0
        public ErrorLogService(
            IErrorLogFactory factory,
            IErrorLogRepository repository
            )
        {
            factory.CheckArgumentIsNull(nameof(factory));
            _factory = factory;

            repository.CheckArgumentIsNull(nameof(repository));
            _repository = repository;
        }
Exemplo n.º 24
0
 public SliderController(ITopCategoryRepository topRepo, IErrorLogRepository errorRepo, IMiddleCategoryRepository midRepo, ISubCategoryRepository subRepo, IProductRepository productRepo, IMapper mapper, ISliderRepository sliderRepo, IBrandRepository brandRepo, IWebHostEnvironment environment)
 {
     _topRepo     = topRepo;
     _midRepo     = midRepo;
     _subRepo     = subRepo;
     _productRepo = productRepo;
     _errorRepo   = errorRepo;
     _mapper      = mapper;
     _sliderRepo  = sliderRepo;
     _brandRepo   = brandRepo;
     _environment = environment;
 }
Exemplo n.º 25
0
 public HomeController(ILogger <HomeController> logger, IMapper mapper, IContactUsRepository contactUsRepo, ICareerRepository careerRepo, IHostingEnvironment hostingEnvironment, IErrorLogRepository errorRepo, IVacancyRepository vacanRepo, IEmailNewsletterRepository emailNewsletterRepo, IStringLocalizer <HomeController> localizer, ICovRepository covRepo)
 {
     _logger              = logger;
     _contactUsRepo       = contactUsRepo;
     _careerRepo          = careerRepo;
     _mapper              = mapper;
     _errorRepo           = errorRepo;
     _vacanRepo           = vacanRepo;
     _hostingEnvironment  = hostingEnvironment;
     _emailNewsletterRepo = emailNewsletterRepo;
     _localizer           = localizer;
     _covRepo             = covRepo;
 }
Exemplo n.º 26
0
 public MasterController(ICustomerRepository customerRepo, IQBOAccessRepository qboaccessRepo, IInvoiceRepository invoiceRepo, ISubscriberRepository subscriberRepo, ILoggerManager logger, IErrorLogRepository errorLogRepo, IConfiguration configuration)
 {
     _customerRepo   = customerRepo;
     _qboaccessRepo  = qboaccessRepo;
     _invoiceRepo    = invoiceRepo;
     _subscriberRepo = subscriberRepo;
     _logger         = logger;
     _errorLogRepo   = errorLogRepo;
     _configuration  = configuration;
     useSandBox      = Convert.ToBoolean(_configuration["CDataConfiguration:useSandBox"]);
     runTimeLicense  = _configuration["CDataConfiguration:connectionRunTimeLicense"];
     serviceName     = GetType().Namespace.Substring(0, GetType().Namespace.IndexOf('.'));
 }
Exemplo n.º 27
0
 public IncomingCommandHander(IConfigRepository configRepository,IIncomingCommandQueueRepository incomingCommandQueueRepository, IConfigService configService, IExecuteCommandLocally executeCommandLocally, IResolveCommand resolveCommand, IUnExecutedCommandRepository unExecutedCommandRepository, IAuditLogWFManager auditLogWfManager, IErrorLogRepository errorLogService, IIncomingCommandEnvelopeQueueRepository incomingCommandEnvelopeQueueRepository)
 {
     _configService = configService;
     _executeCommandLocally = executeCommandLocally;
     _resolveCommand = resolveCommand;
     //_logToServer = logToServer;
     _unExecutedCommandRepository = unExecutedCommandRepository;
     _auditLogWFManager = auditLogWfManager;
     _errorLogService = errorLogService;
     _incomingCommandEnvelopeQueueRepository = incomingCommandEnvelopeQueueRepository;
     _incomingCommandQueueRepository = incomingCommandQueueRepository;
     _configRepository = configRepository;
 }
Exemplo n.º 28
0
 public ErrorLogService(
     ILogger <IErrorLogRepository> logger,
     IErrorLogRepository errorLogRepository,
     IApiErrorLogRequestModelValidator errorLogModelValidator,
     IBOLErrorLogMapper bolerrorLogMapper,
     IDALErrorLogMapper dalerrorLogMapper)
     : base(logger,
            errorLogRepository,
            errorLogModelValidator,
            bolerrorLogMapper,
            dalerrorLogMapper)
 {
 }
Exemplo n.º 29
0
 public AbstractErrorLogService(
     ILogger logger,
     IErrorLogRepository errorLogRepository,
     IApiErrorLogRequestModelValidator errorLogModelValidator,
     IBOLErrorLogMapper bolErrorLogMapper,
     IDALErrorLogMapper dalErrorLogMapper)
     : base()
 {
     this.errorLogRepository     = errorLogRepository;
     this.errorLogModelValidator = errorLogModelValidator;
     this.bolErrorLogMapper      = bolErrorLogMapper;
     this.dalErrorLogMapper      = dalErrorLogMapper;
     this.logger = logger;
 }
 public HomeController(ILogger <HomeController> logger, ITopCategoryRepository topRepo, IMiddleCategoryRepository midRepo, ISubCategoryRepository subRepo, IBrandRepository brandRepo, IProductRepository productRepo, IStringLocalizer <HomeController> localizer, IEmailNewsletterRepository emailNewsletterRepo, IErrorLogRepository errorRepo, IHostingEnvironment hostingEnvironment, IContactUsRepository contactRepo)
 {
     _logger              = logger;
     _topRepo             = topRepo;
     _midRepo             = midRepo;
     _subRepo             = subRepo;
     _brandRepo           = brandRepo;
     _productRepo         = productRepo;
     _localizer           = localizer;
     _emailNewsletterRepo = emailNewsletterRepo;
     _errorRepo           = errorRepo;
     _hostingEnvironment  = hostingEnvironment;
     _contactRepo         = contactRepo;
 }
Exemplo n.º 31
0
 public DatabaseManager(ISettingsManager settingsManager, IAccessTokenRepository accessTokenRepository, IAdministratorRepository administratorRepository, IAdministratorsInRolesRepository administratorsInRolesRepository, IChannelRepository channelRepository, IChannelGroupRepository channelGroupRepository, IConfigRepository configRepository, IContentCheckRepository contentCheckRepository, IContentGroupRepository contentGroupRepository, IContentRepository contentRepository, IContentTagRepository contentTagRepository, IDbCacheRepository dbCacheRepository, IErrorLogRepository errorLogRepository, ILogRepository logRepository, IMaterialArticleRepository materialArticleRepository, IMaterialAudioRepository materialAudioRepository, IMaterialFileRepository materialFileRepository, IMaterialGroupRepository materialGroupRepository, IMaterialImageRepository materialImageRepository, IMaterialMessageRepository materialMessageRepository, IMaterialMessageItemRepository materialMessageItemRepository, IMaterialVideoRepository materialVideoRepository, IPermissionsInRolesRepository permissionsInRolesRepository, IPluginConfigRepository pluginConfigRepository, IRelatedFieldItemRepository relatedFieldItemRepository, IRelatedFieldRepository relatedFieldRepository, IRoleRepository roleRepository, ISiteLogRepository siteLogRepository, ISitePermissionsRepository sitePermissionsRepository, ISiteRepository siteRepository, ISpecialRepository specialRepository, IStatRepository statRepository, ITableStyleRepository tableStyleRepository, ITemplateLogRepository templateLogRepository, ITemplateRepository templateRepository, ITranslateRepository translateRepository, IUserGroupRepository userGroupRepository, IUserMenuRepository userMenuRepository, IUserRepository userRepository, IWxAccountRepository wxAccountRepository, IWxChatRepository wxChatRepository, IWxMenuRepository wxMenuRepository, IWxReplyKeywordRepository wxReplyKeywordRepository, IWxReplyMessageRepository wxReplyMessageRepository, IWxReplyRuleRepository wxReplyRuleRepository, IWxUserRepository wxUserRepository)
 {
     _settingsManager                = settingsManager;
     AccessTokenRepository           = accessTokenRepository;
     AdministratorRepository         = administratorRepository;
     AdministratorsInRolesRepository = administratorsInRolesRepository;
     ChannelRepository               = channelRepository;
     ChannelGroupRepository          = channelGroupRepository;
     ConfigRepository                = configRepository;
     ContentCheckRepository          = contentCheckRepository;
     ContentGroupRepository          = contentGroupRepository;
     ContentRepository               = contentRepository;
     ContentTagRepository            = contentTagRepository;
     DbCacheRepository               = dbCacheRepository;
     ErrorLogRepository              = errorLogRepository;
     LogRepository                 = logRepository;
     MaterialArticleRepository     = materialArticleRepository;
     MaterialAudioRepository       = materialAudioRepository;
     MaterialFileRepository        = materialFileRepository;
     MaterialGroupRepository       = materialGroupRepository;
     MaterialImageRepository       = materialImageRepository;
     MaterialMessageRepository     = materialMessageRepository;
     MaterialMessageItemRepository = materialMessageItemRepository;
     MaterialVideoRepository       = materialVideoRepository;
     PermissionsInRolesRepository  = permissionsInRolesRepository;
     PluginConfigRepository        = pluginConfigRepository;
     RelatedFieldItemRepository    = relatedFieldItemRepository;
     RelatedFieldRepository        = relatedFieldRepository;
     RoleRepository                = roleRepository;
     SiteLogRepository             = siteLogRepository;
     SitePermissionsRepository     = sitePermissionsRepository;
     SiteRepository                = siteRepository;
     SpecialRepository             = specialRepository;
     StatRepository                = statRepository;
     TableStyleRepository          = tableStyleRepository;
     TemplateLogRepository         = templateLogRepository;
     TemplateRepository            = templateRepository;
     TranslateRepository           = translateRepository;
     UserGroupRepository           = userGroupRepository;
     UserMenuRepository            = userMenuRepository;
     UserRepository                = userRepository;
     WxAccountRepository           = wxAccountRepository;
     WxChatRepository              = wxChatRepository;
     WxMenuRepository              = wxMenuRepository;
     WxReplyKeywordRepository      = wxReplyKeywordRepository;
     WxReplyMessageRepository      = wxReplyMessageRepository;
     WxReplyRuleRepository         = wxReplyRuleRepository;
     WxUserRepository              = wxUserRepository;
 }
Exemplo n.º 32
0
 public MasterController(ICustomerRepository customerRepo, IQBOAccessRepository qboaccessRepo, IInvoiceRepository invoiceRepo, ILoggerManager logger, IErrorLogRepository errorLogRepo, IMemoryCache cache, IConfiguration configuration, IWebHostEnvironment env)
 {
     _customerRepo   = customerRepo;
     _qboaccessRepo  = qboaccessRepo;
     _invoiceRepo    = invoiceRepo;
     _errorLogRepo   = errorLogRepo;
     _logger         = logger;
     _cache          = cache;
     _configuration  = configuration;
     serviceName     = GetType().Namespace.Substring(0, GetType().Namespace.IndexOf('.'));
     appClientId     = _configuration["CDataConfiguration:appClientId"];
     appClientSecret = _configuration["CDataConfiguration:appClientSecret"];
     useSandBox      = Convert.ToBoolean(_configuration["CDataConfiguration:useSandBox"]);
     runTimeLicense  = _configuration["CDataConfiguration:connectionRunTimeLicense"];
     _env            = env;
 }
        public void OnException(ExceptionContext filterContext)
        {
            //Send ajax response
            if (filterContext.HttpContext.Request.Headers["X-Requested-With"] == "XMLHttpRequest")
            {
                filterContext.Result = new JsonResult
                {
                    JsonRequestBehavior = JsonRequestBehavior.AllowGet,
                    Data = new
                    {
                        Message = "An error has occured. Please try again later.",
                    }
                };
                filterContext.HttpContext.Response.StatusCode = 500;
                filterContext.ExceptionHandled = true;
            }


            //get Injection Repository
            IErrorLogRepository repo = DependencyResolver.Current.GetService <IErrorLogRepository>();

            //Log the error
            var error = new ErrorLog()
            {
                Message        = filterContext.Exception.Message,
                StackTrace     = filterContext.Exception.StackTrace,
                ControllerName = filterContext.Controller.GetType().Name,
                TargetedResult = filterContext.Result.GetType().Name,
                SessionId      = (string)filterContext.HttpContext.Request["LoanId"],
                UserAgent      = filterContext.HttpContext.Request.UserAgent,
                Timestamp      = DateTime.Now
            };

            repo.Add(error);

            ////Send an email notification
            //MailMessage email = new MailMessage();
            //email.From = new MailAddress("*****@*****.**");
            //email.To.Add(new MailAddress(ConfigurationManager.AppSettings["ErrorEmail"]));
            //email.Subject = "An error has occured";
            //email.Body = filterContext.Exception.Message + Environment.NewLine
            //    + filterContext.Exception.StackTrace;
            //SmtpClient client = new SmtpClient("localhost");
            //client.Send(email);
        }
Exemplo n.º 34
0
        //our constructor
        public OrderOperations(IDataRepository dataRepository = null, IErrorLogRepository errorLogRepository = null)
        {
            if (dataRepository != null)
            {
                _repo = dataRepository;
            }
            else
            {
                _repo = DataFactory.CreateDataRepository();
            }

            if (errorLogRepository != null)
            {
                _errorLogRepository = errorLogRepository;
            }
            else
            {
                _errorLogRepository = new ErrorLogRepository();
            }
        }
        public ErrorLogAppServiceTest()
        {
            fakeData.AddRange(new List <ErrorLog>()
            {
                new ErrorLog()
                {
                    Id = Guid.NewGuid(), Message = "Error Message 1", Archieved = false
                },
                new ErrorLog()
                {
                    Id = Guid.NewGuid(), Message = "Error Message 2", Archieved = false
                },
                new ErrorLog()
                {
                    Id = Guid.NewGuid(), Message = "Error Message 3", Archieved = false
                },
            });

            var fakeErrorLogs = fakeData.AsQueryable();
            var fakeDbSet     = new Mock <DbSet <ErrorLog> >();

            fakeDbSet.As <IQueryable <ErrorLog> >().Setup(x => x.Provider).Returns(fakeErrorLogs.Provider);
            fakeDbSet.As <IQueryable <ErrorLog> >().Setup(x => x.Expression).Returns(fakeErrorLogs.Expression);
            fakeDbSet.As <IQueryable <ErrorLog> >().Setup(x => x.ElementType).Returns(fakeErrorLogs.ElementType);
            fakeDbSet.As <IQueryable <ErrorLog> >().Setup(x => x.GetEnumerator()).Returns(fakeErrorLogs.GetEnumerator());
            fakeDbSet.Setup(x => x.Remove(It.IsAny <ErrorLog>())).Callback <ErrorLog>((entity) => fakeData.Remove(entity));

            _fakeContext = new Mock <CentralDeErrosContext>();
            _fakeContext.Setup(m => m.Set <ErrorLog>()).Returns(fakeDbSet.Object);

            _repository = new ErrorLogRepository(_fakeContext.Object);

            _mapper = new Mapper(
                new MapperConfiguration(
                    configure => {
                configure.AddProfile <AutoMappingDomainToViewModel>();
                configure.AddProfile <AutoMappingViewModelToDomain>();
            }
                    )
                );
        }
 public HomeController(ITopCategoryRepository topRepo, IProductRepository productRepo, IErrorLogRepository errorRepo, IHttpContextAccessor httpContextAccessor, IMiddleCategoryRepository midRepo, ISubCategoryRepository subRepo, IFavoriteProductRepository fpRepo, ICustomerRepository customerRepo, IBrandRepository brandRepo, IMapper mapper, IWebHostEnvironment environment, IProductPhotoRepository photoRepo, IAdminRepository adminRepo, IAdProductRepository adproRepo, IContactUsRepository contactRepo, IEmailNewsletterRepository newsRepo, IFavoriteProductRepository favRepo, IMiniSliderRepository miniRepo, ISliderRepository sliderRepo)
 {
     _topRepo             = topRepo;
     _productRepo         = productRepo;
     _errorRepo           = errorRepo;
     _httpContextAccessor = httpContextAccessor;
     _midRepo             = midRepo;
     _subRepo             = subRepo;
     _fpRepo       = fpRepo;
     _customerRepo = customerRepo;
     _brandRepo    = brandRepo;
     _mapper       = mapper;
     _environment  = environment;
     _photoRepo    = photoRepo;
     _adminRepo    = adminRepo;
     _adproRepo    = adproRepo;
     _contactRepo  = contactRepo;
     _newsRepo     = newsRepo;
     _favRepo      = favRepo;
     _miniRepo     = miniRepo;
     _sliderRepo   = sliderRepo;
 }
Exemplo n.º 37
0
		public ErrorLog(IErrorLogRepository errorLogRepository)
		{
			_errorLogRepository = errorLogRepository;
		}
Exemplo n.º 38
0
 public MiniSliderComponent(IMiniSliderRepository miniSliderRepo, IMapper mapper, IErrorLogRepository errorRepo)
 {
     _miniSliderRepo = miniSliderRepo;
     _mapper         = mapper;
     _errorRepo      = errorRepo;
 }
Exemplo n.º 39
0
Arquivo: Startup.cs Projeto: z-kf/cms
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ISettingsManager settingsManager, IPluginManager pluginManager, IErrorLogRepository errorLogRepository, IOptions <SenparcSetting> senparcSetting)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseExceptionHandler(a => a.Run(async context =>
            {
                var exceptionHandlerPathFeature = context.Features.Get <IExceptionHandlerPathFeature>();
                var exception = exceptionHandlerPathFeature.Error;

                string result;
                if (env.IsDevelopment())
                {
                    result = TranslateUtils.JsonSerialize(new
                    {
                        exception.Message,
                        exception.StackTrace,
                        AddDate = DateTime.Now
                    });
                }
                else
                {
                    result = TranslateUtils.JsonSerialize(new
                    {
                        exception.Message,
                        AddDate = DateTime.Now
                    });
                }
                context.Response.ContentType = "application/json";
                await context.Response.WriteAsync(result);
            }));

            app.UseCors(CorsPolicy);

            app.UseForwardedHeaders(new ForwardedHeadersOptions
            {
                ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
            });

            //app.UseHttpsRedirection();

            var options = new DefaultFilesOptions();

            options.DefaultFileNames.Clear();
            options.DefaultFileNames.Add("index.html");
            app.UseDefaultFiles(options);

            //if (settingsManager.Containerized)
            //{
            //    app.Map($"/{DirectoryUtils.SiteFiles.DirectoryName}/assets", assets =>
            //    {
            //        assets.UseStaticFiles(new StaticFileOptions
            //        {
            //            FileProvider = new PhysicalFileProvider(PathUtils.Combine(settingsManager.ContentRootPath, "assets"))
            //        });
            //    });
            //}

            app.UseStaticFiles();

            var supportedCultures = new[]
            {
                new CultureInfo("en-US"),
                new CultureInfo("zh-CN")
            };

            app.UseRequestLocalization(new RequestLocalizationOptions
            {
                DefaultRequestCulture = new RequestCulture("zh-CN"),
                // Formatting numbers, dates, etc.
                SupportedCultures = supportedCultures,
                // UI strings that we have localized.
                SupportedUICultures = supportedCultures
            });

            app.UseRouting();

            app.UseAuthentication();
            app.UseAuthorization();

            app.UsePluginsAsync(settingsManager, pluginManager, errorLogRepository).GetAwaiter().GetResult();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapHealthChecks("/healthz");

                endpoints.MapControllers();
                endpoints.MapRazorPages();
            });
            //api.UseEndpoints(endpoints => { endpoints.MapControllerRoute("default", "{controller}/{action}/{id?}"); });

            app.UseRequestLocalization();

            RegisterService.Start(senparcSetting.Value)
            //自动扫描自定义扩展缓存(二选一)
            .UseSenparcGlobal(true)
            //指定自定义扩展缓存(二选一)
            //.UseSenparcGlobal(false, () => GetExCacheStrategies(senparcSetting.Value))
            ;

            app.UseOpenApi();
            app.UseSwaggerUi3();
            app.UseReDoc(settings =>
            {
                settings.Path         = "/api/docs";
                settings.DocumentPath = "/swagger/v1/swagger.json";
            });
        }
Exemplo n.º 40
0
		public ReportGenerator(IErrorLogRepository repository)
		{
			_repository = repository;
			_repository.OnInitialized += RepositoryOnInitialized;
		}
Exemplo n.º 41
0
 public Logger(IErrorLogRepository ErrorLogRepository, ILogErrorEmailer LogErrorEmailer)
     : base(ErrorLogRepository, LogErrorEmailer)
 {
 }
Exemplo n.º 42
0
 public PerformanceController(ISqlJobMetricRepository sql_job_metric_repo, IErrorLogRepository error_log_repo)
 {
     this.sql_job_metric_repo = sql_job_metric_repo;
     this.error_log_repo = error_log_repo;
 }
Exemplo n.º 43
0
 public ErrorLogService(IErrorLogRepository objRepository)
 {
     this._objRepository = objRepository;
 }
 public ErrorLogExporter(IErrorLogRepository repository, IDatabaseCreator databaseCreator)
 {
     _repository = repository;
     _databaseCreator = databaseCreator;
     _cancel = false;
 }