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 used to be able to access UmbracoForms data with FormStorage() like this:
But when trying to do this in V8 it seems like the accessibility level has been changed and I get the error of "'FormStorage' is inaccessible due to its protection level."
What is the new way of accessing the Forms storage, records data in V8 now?
FormStorage is now registered as a singleton with Umbraco V8's new lightject underlying dependency injection framework:
This means you can gain access to the FormStorage by injecting it into the constructor of the class you are working in:
public class SomeCustomController : UmbracoAuthorizedJsonController
private readonly IFormStorage _formStorage;
public SomeCustomController(IFormStorage formStorage)
_formStorage = formStorage;
Then you can use _formStorage in your methods..
Failing that, eg you are choosing not to use DI, or it would be difficult to implement in your custom code then you can use the service locator pattern to retrieve the instance of IFormStorage:
IFormStorage _formStorage = Current.Factory.GetInstance<IFormStorage>();
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted