Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I have created a custom section which is built using AngularJS and Entity Framework.
I am inheriting from UmbracoAuthorizedJsonController in my custom section controller.
I have a method which saves some data using logic i have created within my Entity Framework class. This saves to my database successfully.
Does my method to save data need to be decorated by attributes such as [HttpPost] or does Umbraco handle this?
No Umbraco isn´t handling the as [HttpPost] or [HttpGet] if you follow the UmbracoAuthorizedJsonControllerimplementation you´ll find the MVC ApiContoller.
Umbraco is trying to be close to what MVC would normally do, with some modification.
Thanks Lucas, so i should still implement all attributes as necessary myself i.e. [HttpGet], [HttpPost] etc?
Would you happen to know if the [Authorise] attribute would work in Umbraco the same way it does for MVC apps or is this not necessary as UmbracoAuthorizedJsonController is already taking care of that?
No need to make a custom implementation of the attributes. You can simply ref the using of using System.Web.Http;
And there is no need for the [Authorize] attribute when you inhrites the class UmbracoAuthorizedJsonController to your controller.
The UmbracoAuthorizedJsonController is build in to only allow authorize Umbraco users. Read more here: https://our.umbraco.com/Documentation/Reference/Routing/Authorized/#routing-requirements-for-backoffice-authentication
If it is members you working with at the UmbracoApiController and need to check authentication, then read more here: https://our.umbraco.com/Documentation/Reference/Routing/Umbraco-API-Controllers/authorization-v7
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted