public MailServiceController(IConfiguration config, PolicyManager policyManager, IndustryManager industryManager)
        {
            Config         = config;
            _policyManager = policyManager;
            AppSettings    = config.GetSection("AppSettings")
                             .Get <AppSettingsModel>();

            graphSettingsModel = config.GetSection("GraphApi")
                                 .Get <GraphSettingsModel>();

            this.industryManager = industryManager;

            SigningCredentials = new Lazy <X509SigningCredentials>(() =>
            {
                var certStore = new X509Store(StoreName.My, StoreLocation.CurrentUser);
                certStore.Open(OpenFlags.ReadOnly);
                var certCollection = certStore.Certificates.Find(
                    X509FindType.FindByThumbprint,
                    AppSettings.SigningCertThumbprint,
                    false);
                // Get the first cert with the thumb-print
                if (certCollection.Count > 0)
                {
                    return(new X509SigningCredentials(certCollection[0]));
                }

                throw new Exception("Certificate not found");
            });
        }
Esempio n. 2
0
 public CatalogItemController(
     ICatalogItemViewService catalogItemViewService,
     ICatalogItemManager catalogItemManager,
     IndustryManager industryManager)
     : base(industryManager)
 {
     _catalogItemViewService = catalogItemViewService ?? throw new ArgumentNullException(nameof(catalogItemViewService));
     _catalogItemManager     = catalogItemManager ?? throw new ArgumentNullException(nameof(catalogItemManager));
 }
        public AccountController(
            ITrolleyViewService trolleyViewService,
            ITrolleyManager trolleyManager,
            IConfiguration config,
            IdentityService identityService,
            PolicyManager policyManager,
            IndustryManager industryManager) : base(industryManager)
        {
            _trolleyViewService  = trolleyViewService ?? throw new ArgumentNullException(nameof(trolleyViewService));
            _trolleyManager      = trolleyManager ?? throw new ArgumentNullException(nameof(trolleyManager));
            this.identityService = identityService;
            _policyManager       = policyManager;

            Config = config;
        }
Esempio n. 4
0
 public CheckoutController(ITrolleyViewService trolleyViewService, ITrolleyManager trolleyManager, IndustryManager industryManager) :
     base(industryManager)
 {
     _trolleyViewService = trolleyViewService ?? throw new ArgumentNullException(nameof(trolleyViewService));
     _trolleyManager     = trolleyManager ?? throw new ArgumentNullException(nameof(trolleyManager));
 }
Esempio n. 5
0
 public ConfigurationController(PolicyManager policyManager, IndustryManager industryManager) : base(industryManager)
 {
     _policyManager = policyManager;
 }
Esempio n. 6
0
 public HomeController(
     ICatalogItemViewService catalogItemViewService,
     IndustryManager manager) : base(manager)
 {
     _catalogItemViewService = catalogItemViewService;
 }
 public BaseController(IndustryManager industryManager)
 {
     _industryManager = industryManager;
 }
 public PantryController(IPantryViewService pantryViewService, IPantryManager pantryManager, IndustryManager industryManager) :
     base(industryManager)
 {
     _pantryViewService = pantryViewService ?? throw new ArgumentNullException(nameof(pantryViewService));
     _pantryManager     = pantryManager ?? throw new ArgumentNullException(nameof(pantryManager));
 }
 public CatalogItemViewService(IRepository <CatalogItem> catalogItemRepository, IndustryManager manager)
 {
     _catalogItemRepository = catalogItemRepository ?? throw new ArgumentNullException(nameof(catalogItemRepository));
     _manager = manager;
 }