public ActionResult <Guid> Create(BurgerCommand command) { var sw = Stopwatch.StartNew(); var burger = Burger.MakeBurger(command.Type, command.CheeseQuantity, command.MeatQuantity); sw.Stop(); _logger.LogInformation($"Burger {burger.Id} with Cheese {burger.Cheese.ToString()} has made in {sw.ElapsedMilliseconds}"); return(Ok(burger.Id)); }
public Task Consume(ConsumeContext <BurguerCommand> context) { var sw = Stopwatch.StartNew(); var burger = Burger.MakeBurger(context.Message.Type, context.Message.CheeseQuantity, context.Message.MeatQuantity); sw.Stop(); Console.WriteLine($"Burger {burger.Id} with Cheese {burger.Cheese.ToString()} has made in {sw.ElapsedMilliseconds}"); context.Publish(new BurgerResponse { Id = burger.Id }); return(Task.CompletedTask); }