Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [AuthorizeProduct]
- public IHttpActionResult Get (int id)
- {
- Product product = _repository.Get (id);
- if (product == null)
- {
- return NotFound();
- }
- return Ok(product);
- }
- public class AuthorizeProductAttribute : AuthorizationFilterAttribute
- {
- public override void OnAuthorization(
- System.Web.Http.Controllers.HttpActionContext actionContext)
- {
- //do authorization
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement