LINQ中,调用分页存储过程时,出现的问题。
将存储过程拖进dbml文件时,其designer.cs文件会自动生成如下代码:
[Function(Name="dbo.Page_CountSort")] public int Page_CountSort([Parameter(Name="Table", DbType="VarChar(50)")] string table, [Parameter(Name="Filter", DbType="VarChar(1000)")] string filter, [Parameter(Name="Count", DbType="Int")] System.Nullable<int> count, [Parameter(DbType="VarChar(50)")] string id, [Parameter(Name="CurrPage", DbType="Int")] System.Nullable<int> currPage, [Parameter(DbType="Int")] System.Nullable<int> sortid) { IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), table, filter, count, id, currPage, sortid); return ((int)(result.ReturnValue)); }create proc lll as select * from tablename
[Function(Name="dbo.lll")] public ISingleResult<lllResult> lll() { IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod()))); return ((ISingleResult<lllResult>)(result.ReturnValue)); }