コード例 #1
0
        public static IServiceCollection AddSlipService(this IServiceCollection serviceCollection, Action <SlipServiceSettings> setupAction)
        {
            SlipServiceSettings slipSettings = setupAction?.CreateTargetAndInvoke();

            return(serviceCollection.AddSingleton <ISlipRepository>(new SlipRepository(slipSettings.SlipComponentsRepositoryPath))
                   .AddSingleton((sp) => TraceDecorator <ISlipService> .Create(new SlipService(sp.GetRequiredService <ISlipRepository>(), sp.GetRequiredService <ICatalogService>(), slipSettings))));
        }
コード例 #2
0
        public SlipService(ISlipRepository slipRepository, ICatalogService catalogService, SlipServiceSettings slipSettings)
        {
            _slipRepository = slipRepository;
            _catalogService = catalogService;
            _slipSettings   = slipSettings;

            _printDocument = new PrintDocument();
        }