private void AddOrderLine(Guid orderId, Guid productId, ActionExecutionContext context) { context.Out.WriteLine("Enter amount of products"); var temp = context.In.ReadLine(); int quantity; while (!Int32.TryParse(temp, out quantity)) { context.Out.WriteLine("Enter correct amount of products"); temp = context.In.ReadLine(); } _orderApi.AddOrderLine(orderId, productId, quantity); }