Adam,
AdamK wrote:If I understand correctly, you simply need to use SpecificationAttributeService! Check out other services and how they use other repository / service via constructor injection.
Here is what I did in response to what I
think you mean by constructor injection.
I did a solution search for the method
GetSpecificationAttributes.One of the places that it is used is:
Nop.Web\Administration\Controllers\ProductController.cs. It calls the method this way: foreach (var sa in _specificationAttributeService.GetSpecificationAttributes())
In ProductController, "_specificationAttributeService" is defined this way:
private readonly ISpecificationAttributeService _specificationAttributeService;
In ProductController, "_specificationAttributeService" is initialized in the constructor body this way:
this._specificationAttributeService = specificationAttributeService;
"specificationAttributeService" is a parameter being passed in to the ProductController constructor.
How those 44 parameters are being passed to ProductController, I have no idea. I can only assume it is being done by what you call "constructor injection" considering this line in the Nop.Web\Administration\Infrastructure\DependencyRegistrar:
builder.RegisterType<ProductController>()
.WithParameter(ResolvedParameter.ForNamed<ICacheManager>("nop_cache_static"));
If I try to code my class with that type of coding, I get all kinds of errors.
I thank you and everyone else for your continued effort and time in trying to help my stupid brain understand how to use SpecificationAttributeService methods in my class.
Tony