예제 #1
0
파일: Program.cs 프로젝트: Calabonga/SOLID
        static void Main(string[] args)
        {
            #region Container

            var container = AutofacContainer.Create();

            #endregion

            var machine = container.Resolve <DrawMachine>();

            machine.DrawAll();
        }
예제 #2
0
        static void Main(string[] args)
        {
            #region Container creations and some resolvings
            var container       = AutofacContainer.Create();
            var settingsManager = container.Resolve <AppSettingsManager>();
            #endregion

            var appSettings = settingsManager.Load();

            Logger.LogInfo($"ApplicationName:  {appSettings.ApplicationName}");
            Logger.LogInfo($"DefaultPageSize:  {appSettings.DefaultPageSize}");

            appSettings.ApplicationName = $"ApplicationName updated at {DateTime.Now}";
            appSettings.DefaultPageSize = 25;

            settingsManager.Save(appSettings);

            Logger.LogInfo($"ApplicationName:  {appSettings.ApplicationName}");
            Logger.LogInfo($"DefaultPageSize:  {appSettings.DefaultPageSize}");
        }