protected void Application_Start()
 {
     AreaRegistration.RegisterAllAreas();
     FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     BundleConfig.RegisterBundles(BundleTable.Bundles);
     DependencyConfig.ConfigureDependencies();
 }
Exemple #2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc();

            services.AddSwaggerGen(c =>
            {
                c.SwaggerDoc("v1", new Info
                {
                    Title       = "My Core.WebApi Starter kit",
                    Version     = "v1",
                    Description = "This is a WebApi.Core starter kit.",
                    //TermsOfService = "None",
                    //Contact = new Contact { Name = "Vinicius Paiva", Email = "*****@*****.**", Url = "https://www.linkedin.com/in/vinicius-da-silva-50963923" },
                });

                //Set the comments path for the swagger json and ui.
                var basePath = PlatformServices.Default.Application.ApplicationBasePath;
                var xmlPath  = Path.Combine(basePath, "WebApi.BaseApp.xml");
                c.IncludeXmlComments(xmlPath);
            });
            services.AddMvcCore().AddApiExplorer();
            DependencyConfig.ConfigureDependencies(services, Configuration);
        }