/// <summary> /// Initializes a new instance of the <see cref="FormApiController"/> class. /// Constructor /// </summary> /// <param name="gleanerContext"> /// The <see cref="IGleanerContext"/> /// </param> public FormApiController(IGleanerContext gleanerContext) : base(gleanerContext) { _formService = GleanerContext.Services.FormService; var settingService = GleanerContext.Services.SettingService as SettingService; Int32.TryParse(settingService.AllSettings["ItemsPerPage"].IfNotNull(x => x.Value), out _itemsPerPage); }
/// <summary> /// Initializes a new instance of the <see cref="AgentApiController"/> class. /// Constructor /// </summary> /// <param name="gleanerContext"> /// The <see cref="IGleanerContext"/> /// </param> public AgentApiController(IGleanerContext gleanerContext) : base(gleanerContext) { _agentService = GleanerContext.Services.AgentService; var settingService = GleanerContext.Services.SettingService as SettingService; Int32.TryParse(settingService.AllSettings["ItemsPerAutoComplete"].IfNotNull(x => x.Value), out _autoCompleteResultAmount); Int32.TryParse(settingService.AllSettings["ItemsPerPage"].IfNotNull(x => x.Value), out _itemsPerPage); }
/// <summary> /// Initializes a new instance of the <see cref="SettingsApiController"/> class. /// This is a helper contructor for unit testing /// </summary> /// <param name="gleanerContext"> /// The gleaner Context. /// </param> /// <param name="umbracoContext"> /// The umbraco Context. /// </param> internal SettingsApiController(IGleanerContext gleanerContext, UmbracoContext umbracoContext) : base(gleanerContext, umbracoContext) { _settingService = GleanerContext.Services.SettingService as SettingService; }
/// <summary> /// Initializes a new instance of the <see cref="SettingsApiController"/> class. /// Constructor /// </summary> /// <param name="gleanerContext"> /// The gleaner context /// </param> public SettingsApiController(IGleanerContext gleanerContext) : base(gleanerContext) { _settingService = GleanerContext.Services.SettingService as SettingService; }