Пример #1
0
        public NewItemViewModel(IStarWarsDataService dataService)
        {
            _dataService = dataService;

            Characters = new ObservableCollection <Character>();
        }
Пример #2
0
 /// <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));
 }
Пример #3
0
 /// <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;
 }