public String[][] GetAllItems()
{
FoodCityData.ShoppingBuddyEntities fdContext = new FoodCityData.ShoppingBuddyEntities();
IQueryable<Item> Query =
from c in fdContext.Item
select c;
List<Item> AllfNames = Query.ToList();
int arrayZise = AllfNames.Count;
String[,] xx = new String[arrayZise,2];
int i = 0;
int j = 0;
foreach(Item x in AllfNames)
{
xx[i,0] = x.ItemName.ToString();
xx[i, 1] = x.ItemPrice.ToString();
i++;
}
return xx[2,2]; // how do i write return type?
}
我在此代码段返回类型中遇到错误。我可以知道如何正确编写此方法吗?