Created
May 28, 2021 21:11
-
-
Save manoj-choudhari-git/50493a973c2ad2e2666cb59b7fd31302 to your computer and use it in GitHub Desktop.
.NET Core Web API Application - Attribute Routing Setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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