public MainWindow() { var container = DependencyConfig.GetContainer(); var userService = container.Resolve <IUserService>(); var frienService = container.Resolve <IFriendService>(); InitializeComponent(); }
public static void Raise <T>(T evento) where T : IDomainEvent { var handles = DependencyConfig.GetContainer().GetAllInstances <IHandle <T> >(); foreach (var handle in handles) { handle.Handle(evento); } }
public void Configuration(IAppBuilder app) { var config = new HttpConfiguration(); WebApiConfig.Register(config); SwaggerConfig.Register(config); config.DependencyResolver = DependencyConfig.GetContainer(); AuthZeroConfig.ConfigureAuthZero(app); app.UseCors(CorsOptions.AllowAll); app.UseWebApi(config); }
protected override void OnStart(string[] args) { AddLog("Start"); container = DependencyConfig.GetContainer(); var scope = container.BeginLifetimeScope(); userService = scope.Resolve <IUserService>(); messageService = scope.Resolve <IMessageService>(); Task task = new Task(() => { while (!cancellationToken.IsCancellationRequested) { var messages = messageService.GetUnreadMessages(); userService.UserNotification(messages); Thread.Sleep(1000); } }); }