static void Main(string[] args) { #region Dependecy container _container = DependencyContainer.Create(); var orderProvider = _container.Resolve <IOrderProvider>(); var notificationProvider = _container.Resolve <INotificationProvider>(); #endregion var orderId = 101; var newStatus = Status.Approved; PrintOrders("Before changes"); var changeOrderOperation = orderProvider.ChangeStatus(orderId, newStatus); if (!changeOrderOperation.Ok) { var notifyOperation = notificationProvider.NotifyAdminOrderNotFound(orderId); if (!notifyOperation.Ok) { Logger.LogError(notifyOperation.Error); Logger.LogError(changeOrderOperation.Error); return; } Logger.LogError(changeOrderOperation.Error); return; } var customer = changeOrderOperation.Result.Customer; notificationProvider.NotifyCustomerOrderUpdated(customer.Email); PrintOrders("After changed"); }
static void Main(string[] args) { var container = DependencyContainer.Create(); var configuration = container.Resolve <AppConfiguration>(); var settings = configuration.Config; Console.WriteLine($"Hello World! [settings.Name={settings.Name}]"); }
/// <inheritdoc /> protected override void OnStartup(StartupEventArgs e) { Container = DependencyContainer.Create(); base.OnStartup(e); }