Hi, I want to decorate the Google tracking script generators, specifically TrackingScriptGeneratorGoogleTagManager
and TrackingScriptGeneratorGoogleUniversal
.
I try to decorate it by implementing the class, and adding the ServiceDecorator
attribute. However, as the service is actually of type TrackingScriptGenerator
I can only decorate that service, I guess. I’m not sure how I can decorate a specific implementation of a service, if you understand what I mean?
Example:
[ServiceDecorator(typeof(TrackingScriptGenerator), Name = nameof(TrackingScriptGeneratorGoogleTagManager))]
public class TrackingScriptGeneratorGoogleTagManagerImpl : TrackingScriptGeneratorGoogleTagManager
{
private readonly TrackingScriptGeneratorGoogleTagManager _parent;
public TrackingScriptGeneratorGoogleTagManagerImpl(TrackingScriptGeneratorGoogleTagManager parent)
{
_parent = parent;
}
}
Using this code, I get the following exception:
A suitable constructor for type 'Litium.Accelerator.Mvc.Tracking.TrackingScriptGeneratorGoogleTagManagerImpl' could not be located. Ensure the type is concrete and services are registered for all parameters of a public constructor.
Litium version: 7.7.9