我试图从存储过程中获取数据
CREATE PROCEDURE [Asset].[GetAssetForGrid]
@Skip INT,
@Take INT,
@TotalRows INT OUTPUT
AS
BEGIN
EXEC GetPaged @DataSource = 'Asset.vAssetNest'
,@Skip = @Skip
,@Take = @Take
,@TotalRows = @TotalRows
END
C#代码:
var param = new DynamicParameters();
param.Add("@Skip", request.Skip, direction: ParameterDirection.Input);
param.Add("@Take", request.Take, direction: ParameterDirection.Input);
param.Add("@TotalRows", DbType.Int32, direction: ParameterDirection.Output);
var resultDb = _dbContext.DbConnection.Query<TEntity>("Asset.GetAssetForGrid", param, commandType: CommandType.StoredProcedure);
但是我无法获取任何数据。如果我全部替换为
SELECT *
FROM Asset.vAssetNest
然后我得到了结果。
我如何从Exec GetPaged
获得结果?