Пример #1
0
        //Constructor
        public ScBookingService(ApplicationDbContext dbContext, IHttpContextAccessor httpAccessor,
                                IConfiguration configuration, SessionService sessionService,
                                IViewRenderService viewRenderService, ScCacheService scCacheService)
        {
            // default log level is error (less verbose)
            var logLevel = LogEventLevel.Error;

            //check if this is running on a developer workstation (outside OpenShift)
            string tagName = configuration["TAG_NAME"] ?? "";

            if (tagName.ToLower().Equals("localdev"))
            {
                IsLocalDevEnvironment = true;
                logLevel = LogEventLevel.Debug;
            }

            // check if this is the OpenShift development environment
            if (tagName.ToLower().Equals("dev"))
            {
                logLevel = LogEventLevel.Information;
            }

            //setup error logger settings
            Logger logger = new LoggerConfiguration()
                            .WriteTo.Console(logLevel)
                            .CreateLogger();

            _client            = OnlineBookingClientFactory.GetClient(configuration);
            _dbContext         = dbContext;
            _httpContext       = httpAccessor.HttpContext;
            _session           = sessionService;
            _viewRenderService = viewRenderService;
            _cache             = scCacheService;
            _mailService       = new MailService("SC", configuration, logger);
        }
Пример #2
0
 public SelectListService(ScCacheService cacheService)
 {
     _cacheService = cacheService;
 }