I have the following Repository and Class;
public interface IValueService
{
GetAll();
}
public class ValueService : IValueService
{
private DataContext _context;
public ValueService(DataContext context)
{
_context = context;
}
public GetAll()
{
// do something
}
}
In my Startup.cs;
services.AddScoped<IValueService, ValueService>();
How would i call the method GetAll() from Startup or from another Class?
EDIT: Answered in; .NET Core 2 - Create instance of controller class which has a repository