Stored Procedure return List result

Jun 14, 2012 at 11:36 AM
Edited Jun 14, 2012 at 12:06 PM

now is return int rowsAffected 

how to Stored Procedure return List result ?  

也就是 存储过程 如何 返回列表  not  int rowsAffected 

2012-6-14 19:06 update:
ok了  

 dynamic citys = db.Context().Sql("Applet_RandomTop10City")            .CommandType(DbCommandTypes.StoredProcedure)            .Parameter("phones", phones).Query<randomTop>(); 

Coordinator
Jun 15, 2012 at 6:13 AM

You need to use var or List<randomTop> instead of dynamic:

var citys = db.Context().Sql("Applet_RandomTop10City")            .CommandType(DbCommandTypes.StoredProcedure)            .Parameter("phones", phones).Query<randomTop>(); 

or

List<randomTop> citys = db.Context().Sql("Applet_RandomTop10City")            .CommandType(DbCommandTypes.StoredProcedure)            .Parameter("phones", phones).Query<randomTop>(); 

Hope this helped