Beispiel #1
0
        public MainWindow()
        {
            var container    = DependencyConfig.GetContainer();
            var userService  = container.Resolve <IUserService>();
            var frienService = container.Resolve <IFriendService>();

            InitializeComponent();
        }
Beispiel #2
0
        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);
            }
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        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);
                }
            });
        }