的列表從一個存儲過程,我回國的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)' –