Using Autofac to inject a dependency into the Main entry point in a console app

前端 未结 4 863
不思量自难忘°
不思量自难忘° 2020-12-10 05:34

Say I have a simple console application:

public static class Program
{
    private static ILog Log { get; set; }

    public static void Main()
    {
                


        
4条回答
  •  南笙
    南笙 (楼主)
    2020-12-10 06:03

    You have to configure a container somewhere. In console apps, Main() is usually that place.

提交回复
热议问题