use*_*482 2 c# nhibernate dictionary
是否可以<int, string>从nhibernate查询中返回Dictionary ,例如:
CreateQuery("select CustomerId, FullName from Customer")
Run Code Online (Sandbox Code Playgroud)
我已经尝试使用.net ToDictionary方法从这个论坛中的一些例子,但我无法让它们工作.
您需要在列表中进行以下操作或枚举,您应该获得dictonary
.ToDictionary(x => x.CustomerId, x => x.FullName);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3750 次 |
| 最近记录: |