public void Initialize() { Data = new List <UrbanizationByState> { urbStateOne, urbStateTwo, urbStateThree }; _ServiceCollection = new ServiceCollection(); _ServiceCollection.AddSingleton(MockDbContextFactory.CreateMockDbContext(Data)); _ServiceCollection.AddSingleton <IUrbanizationByStateStore, UrbanizationByStateStore>(); _ServiceCollection.AddSingleton <IUrbanizationByStateService, UrbanizationByStateService>(); _UrbStateService = _ServiceCollection.BuildServiceProvider().GetRequiredService <IUrbanizationByStateService>(); }
public UrbanizationController(IUrbanizationByStateService urbanizationByStateService, ILogger <UrbanizationController> logger) { _UrbanizationByStateService = urbanizationByStateService; _logger = logger; }