I'm getting an 500 error on request if adding the IVoltRepository
parameters in constructor.
If I remove the parameter IVoltRepository
from the constructor, request will be handled ok.
I've already registered services for DI:
public class VoltProcessing : IVoltProcessing
{
private readonly IVoltRepository _voltRepository;
private readonly ILoggingAttributes _loggingAttributes;
public VoltProcessing(IVoltRepository voltrepository, ILoggingAttributes loggingAttributes)
{
_voltRepository = voltrepository;
_loggingAttributes = loggingAttributes;
}
}
services.AddScoped<IVoltRepository, VoltRepository>();
services.AddSingleton<IVoltProcessing, VoltProcessing>();
I'm getting the 500 error if am using IVoltRepository
as a parameter in the VoltProcessing
constructor.
How can I resolve this?