// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddMvc(); // Configure the service to documentation the Swagger site services.AddSwaggerGen(c => { c.SwaggerDoc("v1", new Info { Title = "Switch Over boilerplate", Version = "v1", Description = "Sample of API REST building with ASP.NET Core", Contact = new Contact { Name = "Riguel Figueiro", Url = "https://github.com/riguelbf" } }); var applicationBasePath = PlatformServices.Default.Application.ApplicationBasePath; var applicationName = PlatformServices.Default.Application.ApplicationName; var pathXmlDoc = Path.Combine(applicationBasePath, $"{applicationName}.xml"); c.IncludeXmlComments(pathXmlDoc); }); // Register Dependency injection DependencyInjectionBootstrapper.RegisterServices(services); }
// 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(); services.AddAutoMapperSetup(); DependencyInjectionBootstrapper.RegisterServices(services); }
public void ConfigureServices(IServiceCollection services) { services.AddJwtAuthentication(Configuration) .AddCustomSwagger() .AddCustomApiVersioning() .AddVersionedApiExplorer(x => x.GroupNameFormat = "'v'VVV") .AddCustomResponseCompression() .AddMediatR(typeof(Startup)) .AddCustomMvcCore() .AddHealthChecks(); DependencyInjectionBootstrapper.RegisterServices(services); SeeddingContext.Seed(Configuration, HostingEnvironment); }
private static void RegisterServices(IServiceCollection services) { DependencyInjectionBootstrapper.RegisterServices(services); }