コード例 #1
0
ファイル: Bootstrapper.cs プロジェクト: binarymash/evelyn
        public void Bootstrap(IServiceProvider serviceProvider, IStartUpCommands startUpCommands)
        {
            var projectionBuilderRegistrar = serviceProvider.GetService <IProjectionBuilderRegistrar>();

            projectionBuilderRegistrar.Register(typeof(EventStreamHandler), _handlerOptions.Value.ProjectionBuilders);

            startUpCommands.Execute().GetAwaiter().GetResult();
        }
コード例 #2
0
#pragma warning disable SA1614 // Element parameter documentation must have text
#pragma warning disable SA1616 // Element return value documentation must have text
        /// <summary>
        /// Adds the Evelyn Management ReST API to the application
        /// </summary>
        /// <param name="app"></param>
        /// <param name="startUpCommands">Optional startup behaviour.</param>
        /// <returns></returns>
        public static IApplicationBuilder UseEvelynApi(this IApplicationBuilder app, IStartUpCommands startUpCommands)
#pragma warning restore SA1616 // Element return value documentation must have text
#pragma warning restore SA1614 // Element parameter documentation must have text
        {
            var bootstrapper = app.ApplicationServices.GetService(typeof(IBootstrapper)) as IBootstrapper;

            bootstrapper.Bootstrap(app.ApplicationServices, startUpCommands);

            return(app);
        }
コード例 #3
0
ファイル: Startup.cs プロジェクト: binarymash/evelyn
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, IStartUpCommands startUpCommands)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseCors(builder => builder
                        .AllowAnyOrigin()
                        .AllowAnyMethod()
                        .AllowAnyHeader());

            app.UseMvc();

            app.UseEvelynApi(startUpCommands);

            app.UseSwagger();
            app.UseSwaggerUI(c =>
            {
                c.SwaggerEndpoint("/swagger/management-api/swagger.json", "Evelyn Management API");
                c.SwaggerEndpoint("/swagger/client-api/swagger.json", "Evelyn Client API");
            });
        }
コード例 #4
0
 // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
 public void Configure(IApplicationBuilder app, IHostingEnvironment env, IStartUpCommands startUpCommands)
 {
     app.UseMvc();
     app.UseEvelynApi(startUpCommands);
 }