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();
        }
Beispiel #2
0
 public DIPlugin(IConfiguration configuration, IDependantService dependantService)
 {
     this.Configuration = configuration;
     _dependantService  = dependantService;
 }
Beispiel #3
0
 public DependantsController(IDependantService service, DataContext context, IMapper mapper)
 {
     this._service = service;
     this._context = context;
     this._mapper  = mapper;
 }