I am working on existing code and need to rewrite or get dependency injection to work inside a static class. First, I don't want to write all static class in this project and pass the interface in the constructor. Is there a work around?
Here is what I have
public static class MyUserClass
{
private readonly IMyDBHelper myDBHelper;
public static string Get()
{
....
}
}
When I build, I get the error
cannot declare instance members in a static class.
Thanks