我有一个绑定到表的LINQ to SQL查询函数,但该函数在“return res.ToList();”上给出错误。
- imo_no 是 int
- position_cordinates 是字符串
- 船只 ID 是 int
- 设备是字符串。
我的功能:
List<T> GetAllInitialize()
{
PositionDataClassesDataContext context = new PositionDataClassesDataContext();
var res = from positions in context.it_positions
join vessels in context.it_vessels on positions.imo_no equals vessels.imo_no
select new { positions.imo_no, positions.position_cordinates, vessels.vessel_id, vessels.equipment };
return res.ToList();
}