public NewItemViewModel(IStarWarsDataService dataService) { _dataService = dataService; Characters = new ObservableCollection <Character>(); }
/// <summary> /// Initializes a new instance of the <see cref="DroidsController" /> class. /// </summary> /// <param name="starWarsData">The star wars data.</param> public DroidsController(IStarWarsDataService starWarsData) { // NOTE: This service is scoped to the request, just like a normal DI request in asp.net core. // the underlying repository is a singleton for app instance (see Startup.cs) _starWarsData = Validation.ThrowIfNullOrReturn(starWarsData, nameof(starWarsData)); }
/// <summary> /// Initializes a new instance of the <see cref="SearchController"/> class. /// </summary> /// <param name="starWarsData">The star wars data.</param> public SearchController(IStarWarsDataService starWarsData) { _starWarsData = starWarsData; }