// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddControllers(); services.AddSwaggerGen(c => { c.SwaggerDoc("v1", new OpenApiInfo { Title = "PackagingService", Version = "v1" }); }); // configure strongly typed settings object services.Configure <AppRequirements>(Configuration.GetSection("AppSettings")); // configure DI for application services services.AddScoped <IPackageSortingService, PackageSortingService>(); // configure DI for helper classes ValidateInput validateInput = new ValidateInput(); services.AddSingleton <ValidateInput>(validateInput); ValidatePackage validatePackage = new ValidatePackage(); services.AddSingleton <ValidatePackage>(validatePackage); }
public PackageSortingService(ValidatePackage validatePackage) { _validatePackage = validatePackage; }