Friday, April 3, 2020

Here are some .NET Core attributes for a Controller.

[AllowAnonymous]
[ApiController]
[Route("api/[controller]")]

 
 

These sit right above the class declaration that inheirts from Controller. The first and the last speak for themselves. The middlemost suggests that all of the actions you will find inside will be tied to HTTP verbs.

No comments:

Post a Comment