Ejemplo n.º 1
0
        //private methods to invoke the relavant event
        private async Task InvokeGetAllBeerCommandAsync(IContext context, GetAllBeerCommand command)
        {
            var triggeredEvent = new GetAllBeerEvent();
            var result         = await actorManager.RequestAsync <BeerEventActor, List <Beer> >(triggeredEvent);

            context.Respond(result);
        }
Ejemplo n.º 2
0
        public async Task <ActionResult> GetAllBeer()
        {
            try
            {
                var         command  = new GetAllBeerCommand();
                List <Beer> beerList = await _actorManager.RequestAsync <BeerCommandActor, List <Beer> >(command);

                return(Ok(beerList));
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
                return(StatusCode(500));
            }
        }