Example #1
0
        static void Main(string[] args)
        {
            Console.WriteLine($"Running eGifter in {Directory.GetCurrentDirectory()}");

            var system = PortalActorSystem.Build();

            var requests = new List <BuyGiftCardRequest>()
            {
                new BuyGiftCardRequest
                {
                    Customer = new Customer {
                        Id = "artur_test"
                    },
                    GiftCard = new GiftCard {
                        Price = 10, Description = "Amazon.com Gift Card"
                    }
                },
                new BuyGiftCardRequest
                {
                    Customer = new Customer {
                        Id = "artur_test"
                    },
                    GiftCard = new GiftCard {
                        Price = 15, Description = "Amazon.com Gift Card"
                    }
                },
            };

            requests.ForEach(r => system.RootActor.Tell(r));
            system.System.WhenTerminated.Wait();
        }
Example #2
0
 public GiftCardsController(PortalActorSystem actorSystem)
 {
     this.ActorSystem = actorSystem;
 }
Example #3
0
 // This method gets called by the runtime. Use this method to add services to the container.
 public void ConfigureServices(IServiceCollection services)
 {
     services.AddSingleton <PortalActorSystem>(PortalActorSystem.Build());
     // Add framework services.
     services.AddMvc();
 }