-
-
Notifications
You must be signed in to change notification settings - Fork 10
Controllers attributes
All controllers attributes can be found in Simplify.Web.Attributes
namespace.
-
[Get("route expression")]
- indicates that a controller handles only HTTP GET request with specified route expression; -
[Post("route expression")]
- indicates that a controller handles only HTTP POST request with specified route expression; -
[Delete("route expression")]
- indicates that a controller handles only HTTP DELETE request with specified route expression; -
[Put("route expression")]
- indicates that a controller handles only HTTP PUT request with specified route expression. -
[Patch("route expression")]
- indicates that a controller handles only HTTP PATCH request with specified route expression. -
[Options("route expression")]
- indicates that a controller handles only HTTP OPTIONS request with specified route expression.
-
[Authorize]
- indicates that a controller requires user to be authenticated, otherwise client will be redirected to login page; -
[Authorize("Role1", "Role2")]
or[Authorize("Role1, Role2")]
- authorize attribute with specifying user roles, only users with one of the specified roles can access controller, otherwise HTTP 403 error will be returned (or controller with Http403 attribute will be called, if it is present. Example:[Authorize(nameof(Privilege.DepartmentsManagement), nameof(Privilege.UsersManagement))]
-
[Priority(1)]
- sets a controller invoke priority, controllers will be sorted and invoked according to their priority number (controllers with lower number will be invoked before controllers with higher number), default controller priority is: 0. -
[Http400]
- indicates that a controller handles HTTP 400 errors (not implemented); -
[Http403]
- indicates that a controller handles HTTP 403 errors (user is authenticated but does not have access rights); -
[Http404]
- indicates that a controller handles HTTP 404 errors (page not found), for example, if user is calling page with specified route expression is not found, then controller with this attribute will be called.
- Getting Started
- Main Simplify.Web principles
- Simplify.Web controllers
- Simplify.Web views
- Simplify.Web templates
- Simplify.Web configuration
- Templates variables
- Static content
- Template factory
- Data collector
- String table
- File reader
- Web context
- Environment
- Dynamic environment
- Language manager
- Redirector
- HTML