have you registered your IRecordReaderService in a composer ?
if you register it via a composer it should be there when the surface controller is initialized.
probably something like :
public class MyRecordReaderComposer: IUserComposer
{
public void Compose(Composition composition)
{
composition.RegisterUnique<IRecordReaderService, RecordReaderService>();
}
}
assuming you implimentation of the RecordReaderService is called RecordReaderService
Umbraco will then pick that class up and register your service when umbraco starts up.
I wondered if that was the direction I needed to head. I had assumed this would work in a similar way to UmbracoHelper which didn't require registration in a composer. I've added a composer but get an error "Cannot access internal class 'RecordReaderService' here".
Dependency Injection help with IRecordReaderService
I'm wanting to retrieve all form entries for a particular form.
_readerService is null and I'm not sure what I'm missing:
I suspect I'm missing something here with my dependency injection process as "_readerService" is null. Any advice appreciated, Thanks.
Hi Tracey,
have you registered your IRecordReaderService in a composer ?
if you register it via a composer it should be there when the surface controller is initialized.
probably something like :
assuming you implimentation of the RecordReaderService is called RecordReaderService
Umbraco will then pick that class up and register your service when umbraco starts up.
Thanks Kevin, I really appreciate your help.
I wondered if that was the direction I needed to head. I had assumed this would work in a similar way to UmbracoHelper which didn't require registration in a composer. I've added a composer but get an error "Cannot access internal class 'RecordReaderService' here".
I'm trying to follow instructions here: https://our.umbraco.com/documentation/Add-ons/umbracoforms/developer/working-with-data/ in order to get submitted form data to process. There isn't really any info on how to implement the RecordReaderService other than "injecting the interface".
This is definitely something I'm new to, I'm assuming there are more steps to get this working. Do you have any further suggestions?
Worked this one out - RecordReaderService is already available but I needed to inject it in the same constructor as the UmbracoHelper:
is working on a reply...