We use Autofac to do some simple dependency injection in our web app. It's all configured and registered in classes that operate behind-the-scenes. It makes injecting stuff in our project painless easy just like this:
//interface
public interface ISuperHereService
{ }
//class that uses the interface
public class SuperHeroFactory
{
public ISuperHeroService SuperHeroService { get; }
public SuperHeroFactory(ISuperHeroService superHeroService)
{
SuperHeroService = superHeroService;
...do all our stuff...
However now I had to create a separate project as a console app. My console app has a Main method.
I'm not at all sure how to inject an interface into the Main method.
Is this possible?
Thanks!