/// <summary> /// Initializes a new instance of the <see cref="GroceryController"/> class. /// </summary> /// <param name="appSettings">The application configuration.</param> /// <param name="logger">The logger to use.</param> /// <param name="localizer">The localized ressources to use.</param> /// <param name="speechToTextService">The <see cref="ISpeechToTextService"/> to use.</param> public GroceryController( IOptions <AppSettings> appSettings, ILogger <GroceryController> logger, IStringLocalizer <GroceryController> localizer, ISpeechToTextService speechToTextService, IGroceryActionService groceryActionService, IGroceryItemService groceryItemService) { if (appSettings == null) { throw new ArgumentNullException(nameof(appSettings)); } if (logger == null) { throw new ArgumentNullException(nameof(logger)); } if (localizer == null) { throw new ArgumentNullException(nameof(localizer)); } if (speechToTextService == null) { throw new ArgumentNullException(nameof(speechToTextService)); } if (groceryActionService == null) { throw new ArgumentNullException(nameof(groceryActionService)); } if (groceryItemService == null) { throw new ArgumentNullException(nameof(groceryItemService)); } this.appSettings = appSettings.Value; this.logger = logger; this.localizer = localizer; this.speechToTextService = speechToTextService; this.groceryActionService = groceryActionService; this.groceryItemService = groceryItemService; }
/// <summary> /// Initializes a new instance of the <see cref="GroceryActionsController"/> class. /// </summary> /// <param name="appSettings">The application configuration.</param> /// <param name="logger">The logger to use.</param> /// <param name="localizer">The localized ressources to use.</param> /// <param name="groceryActionService">The <see cref="IGroceryActionService"/> to use.</param> public GroceryActionsController( IOptions <AppSettings> appSettings, ILogger <GroceryActionsController> logger, IStringLocalizer <GroceryActionsController> localizer, IGroceryActionService groceryActionService) { if (appSettings == null) { throw new ArgumentNullException(nameof(appSettings)); } else { this.appSettings = appSettings.Value; } if (logger == null) { throw new ArgumentNullException(nameof(logger)); } else { this.logger = logger; } if (localizer == null) { throw new ArgumentNullException(nameof(localizer)); } else { this.localizer = localizer; } if (groceryActionService == null) { throw new ArgumentNullException(nameof(groceryActionService)); } else { this.groceryActionService = groceryActionService; } }