ibatis.net:第八天,QueryForDictionary

xml

1     <statement id="FindOrdersByCustomer" parameterClass="string" resultClass="Order">
2       SELECT Id, Customer FROM [Orders] WHERE Customer = #value#
3     </statement>

代码

1         public static void FindOrdersForDictionary()
2         {
3             var mapper = Mapper.Instance();
4 
5             var orders = mapper.QueryForDictionary<int, Order>("FindOrdersByCustomer", "段光伟", "Id");
6             Console.WriteLine(orders.Count);
7         }

备注

使用到 QueryForDictionary 的机会好像并不多。

posted on 2014-02-07 22:56  幸福框架  阅读(916)  评论(0编辑  收藏  举报

导航

我要啦免费统计