내 테이블에서 선택된 행의 ItemNumber, ItemDescription, UnitDescription이라는 3 개의 열 값을 가져 오는 데 사용되는 메서드가 있습니다. 선택한 행의 ItemId 매개 변수를 전달하고 다른 변수의 각 열 값을 가져와야합니다. 내가 모르는 사람 .Can 그것을 바탕으로 일을하는 것은 수행하는 방법을 가르쳐 방법 this.Here 내 코드 -이다이 메소드에서 열 값을 가져 오는 방법은 무엇입니까?
Satpal이 좋은 예를 준public System.Collections.IEnumerable FetchDataItem(int id)
{
var row = (from t1 in context.InventoryUnit
join t2 in context.InventoryItem on t1.UnitId equals t2.UnitId
where t2.ItemId == id
orderby t2.ItemNumber, t2.ItemDescription
select new
{
t2.ItemNumber,
t2.ItemDescription,
t1.UnitDescription
});
return row.ToList();
}
하는대로'는 IEnumerable'에 반환 유형을 설정해야합니다'는 IEnumerable ' –