public TestBase() { var builder = new ConfigurationBuilder() .AddJsonFile("appsettings.json"); _configuration = builder.Build(); var serviceProvider = new ServiceCollection(); //// Add application services. serviceProvider.AddTransient <Repo.IEmployee, Repo.EmployeeService>(); var sp = serviceProvider.BuildServiceProvider(); EmpService = sp.GetService <Repo.IEmployee>(); }
public HomeController(Repo.IEmployee _employee) { employee = _employee; }