的列表从一个存储过程,我回国的int
名单 - 只是作为短小精悍 - 返回INT
SELECT ID FROM Table
这是用短小精悍。下面是我尝试做的尝试。我可以使用相同的方法,但不是int
对象
List<int> ids = new List<int>();
int id = 0;
// Trying to fill a list of ints here
ids = connection.Query("storedprocedure", param, transaction: transaction, commandType: CommandType.StoredProcedure).Select(row => new int { id = row.ID }).ToList();
填充对象相信它的东西在声明的结尾做=> new int
。我相信解决方案非常简单。只是他们中的一个星期五......
干杯
尝试更换'选择(行=>新INT {ID = row.ID})'和'选择(行=> row.ID)' –