public async Task <IActionResult> DeteleOrder(string menuItemName, int menuID) { var expr = from deleteMenuItem in RestaurantDomain.DeleteMenuItemFromDB(menuItemName, menuID) let menuItem = (deleteMenuItem as MenuItemDeleted)?.MenuItem select deleteMenuItem; var result = await interpreter.Interpret(expr, Unit.Default); return(await result.MatchAsync <IActionResult>( async (deleted) => { return (IActionResult)Ok(deleted.MenuItem); }, async (notDeleted) => { return BadRequest(); } )); }