public ActionResult <Guid> Create(FriesCommand command) { var sw = Stopwatch.StartNew(); var fries = Fries.MakeFries(command.Type); sw.Stop(); _logger.LogInformation($"Fries {fries.Type.ToString()} has made in {sw.ElapsedMilliseconds}"); return(Ok(fries.Id)); }
public Task Consume(ConsumeContext <FriesCommand> context) { var sw = Stopwatch.StartNew(); var fries = Fries.MakeFries(context.Message.Type); sw.Stop(); Console.WriteLine($"Fries {fries.Type.ToString()} has made in {sw.ElapsedMilliseconds}"); context.Publish(new FriesResponse { Id = fries.Id }); return(Task.CompletedTask); }