public async Task <IActionResult> SelectRestaurant(String name) { var expr = from selectRestaurant in RestaurantDomain.GetRestaurant(name) let restaurant = (selectRestaurant as RestaurantSelected)?.RestaurantAgg from populatedRestaurant in RestaurantDomain.PopulateRestaurant(restaurant, RestaurantDomain.GetAllMenus, RestaurantDomain.GetAllMenuItems, interpreter) let newRestaurant = (populatedRestaurant as RestaurantPopulated)?.RestaurantAgg select populatedRestaurant; var exprResult = await interpreter.Interpret(expr, Unit.Default); return(await exprResult.MatchAsync <IActionResult>( async (selected) => { return (IActionResult)Ok(JsonConvert.SerializeObject(selected.RestaurantAgg.Restaurant)); }, async (notSelected) => NotFound() )); }