Skip to content

Instantly share code, notes, and snippets.

@manoj-choudhari-git
Created May 28, 2021 21:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manoj-choudhari-git/50493a973c2ad2e2666cb59b7fd31302 to your computer and use it in GitHub Desktop.
Save manoj-choudhari-git/50493a973c2ad2e2666cb59b7fd31302 to your computer and use it in GitHub Desktop.
.NET Core Web API Application - Attribute Routing Setup
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.UseRouting();
app.UseEndpoints(endpoints =>
{
// To load all attribute routes
endpoints.MapControllers();
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment