public void ConfigureServices(IDependantService dependantService) { var services = new ServiceCollection(); var builder = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.DIPlugin.json", optional: false, reloadOnChange: true); var configuration = builder.Build(); services.AddSingleton <IConfiguration>(configuration); services.AddSingleton <IDependantService>(dependantService); services.AddSingleton <ICommand, DIPlugin>(); _serviceProvider = services.BuildServiceProvider(); }
public DIPlugin(IConfiguration configuration, IDependantService dependantService) { this.Configuration = configuration; _dependantService = dependantService; }
public DependantsController(IDependantService service, DataContext context, IMapper mapper) { this._service = service; this._context = context; this._mapper = mapper; }