In the “Program.cs” file, add
builder.Services.AddSingleton<IClassName, ClassName>();
var app = builder.Build();
Where ClassName is the class to inject and IClassName is the interface of the class
In the “Program.cs” file, add
builder.Services.AddSingleton<IClassName, ClassName>();
var app = builder.Build();
Where ClassName is the class to inject and IClassName is the interface of the class