Пример #1
0
        public static void Main(string[] args)
        {
            var container = new Container();
            var dependencyResolver = new SimpleInjectorDependencyResolver(container);

            container.Register<ILogger, ConsoleLogger>();

            var helper = new ExampleConsoleApp(dependencyResolver);
            helper.Run(MainAsync);
        }
Пример #2
0
        public static void Main(string[] args)
        {
            var dependencyResolver = GetSimpleInjectorDependencyResolver();

            // or use your IoC container of choice:
            //var dependencyResolver = GetAutofacDependencyResolver();
            //var dependencyResolver = GetCastleWindsorDependencyResolver();
            //var dependencyResolver = GetUnityDependencyResolver();
            //var dependencyResolver = GetNinjectDependencyResolver();

            // This helper is used because this example is not run as a service. You do not
            // need it in your own applications.
            var helper = new ExampleConsoleApp(dependencyResolver);

            helper.Run(MainAsync);
        }