Exemplo n.º 1
0
            public MixedActor(AkkaDiFixture.ISingletonDependency singleton, IServiceProvider sp)
            {
                _singleton = singleton;
                _scope     = sp.CreateScope();

                Receive <FetchDependencies>(_ =>
                {
                    Sender.Tell(new CurrentDependencies(new AkkaDiFixture.IDependency[] { _transient, _scoped, _singleton }));
                });

                Receive <Crash>(_ => throw new ApplicationException("crash"));
            }
Exemplo n.º 2
0
            public NonDiArgsActor(AkkaDiFixture.ISingletonDependency singleton, IServiceProvider sp, string arg1, string arg2)
            {
                _singleton = singleton;
                _scope     = sp.CreateScope();
                _arg1      = arg1;
                _arg2      = arg2;

                Receive <FetchDependencies>(_ =>
                {
                    Sender.Tell(new CurrentDependencies(new AkkaDiFixture.IDependency[] { _transient, _scoped, _singleton }));
                });

                Receive <string>(str =>
                {
                    Sender.Tell(_arg1);
                    Sender.Tell(_arg2);
                });

                Receive <Crash>(_ => throw new ApplicationException("crash"));
            }