示例#1
0
        public ImageSliderHomeController(INccSettingsService nccSettingsService, ILoggerFactory factory, NccImageSliderService nccImageSliderService)
        {
            _logger = factory.CreateLogger <ImageSliderHomeController>();
            nccImageSliderSettings = new NccImageSliderSettings();

            _nccSettingsService    = nccSettingsService;
            _nccImageSliderService = nccImageSliderService;
            nccImageSliderSettings = _nccSettingsService.GetByKey <NccImageSliderSettings>() ?? new NccImageSliderSettings();
        }
示例#2
0
        public ImageSliderHomeController(NccSettingsService nccSettingsService, ILoggerFactory factory, NccImageSliderService nccImageSliderService)
        {
            _logger = factory.CreateLogger <ImageSliderHomeController>();
            nccImageSliderSettings = new NccImageSliderSettings();

            _nccSettingsService    = nccSettingsService;
            _nccImageSliderService = nccImageSliderService;
            try
            {
                var tempSettings = _nccSettingsService.GetByKey("NccImageSlider_Settings");
                if (tempSettings != null)
                {
                    nccImageSliderSettings = JsonConvert.DeserializeObject <NccImageSliderSettings>(tempSettings.Value);
                }
            }catch (Exception ex)
            {
                _logger.LogError(ex.ToString());
            }
        }