Exemple #1
0
        public static void Main(string[] args)
        {
            var hozaruBootstrapper = new HozaruBootstrapper();

            hozaruBootstrapper.IocManager.RegisterIfNot <IAssemblyFinder, WorkerServiceAssemblyFinder>();
            hozaruBootstrapper.Initialize();
            CreateHostBuilder(args).Build().Run();
        }
Exemple #2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            var hozaruBootstrapper = new HozaruBootstrapper();

            hozaruBootstrapper.IocManager.RegisterIfNot <IAssemblyFinder, WebAssemblyFinder>();
            hozaruBootstrapper.Initialize();

            configureTokenAuthentication(services);

            services.AddCors();
            services.AddControllers();
            services.AddResponseCaching();
            services.AddAuthentication().AddApiKeySupport(options => { });

            services.AddAuthorization();

            services.AddHttpContextAccessor();
            services.AddSingleton <IHttpContextAccessor, HttpContextAccessor>();

            var aspnetCoreServiceResolver = IocManager.Instance.Resolve <IAspnetCoreServiceResolver>();

            aspnetCoreServiceResolver.AddAspnetCoreServices(services);
        }