Exemplo n.º 1
0
 public Task <TResult> QueryMultipleAsync <TRequest, TResult>(
     IMultipleStoredProc <TRequest, TResult> sp,
     TRequest parameters,
     string cacheKey = "")
 {
     return(ExecuteCacheOrGetAsync(sp, parameters, () => QueryMultipleAsyncImpl(sp, parameters), cacheKey));
 }
 private Task <TResult> QueryMultipleAsyncImpl <TRequest, TResult>(
     IMultipleStoredProc <TRequest, TResult> sp,
     TRequest parameters)
 {
     return(QueryAsyncSharedBlock(sp, async connection =>
     {
         var reader = await connection.QueryMultipleAsync(
             sp.StoredProcedureName,
             parameters,
             commandTimeout: sp.CommandTimeoutSecs,
             commandType: CommandType.StoredProcedure);
         return await sp.ReadAsync(reader);
     }));
 }
 private TResult QueryMultipleImpl <TRequest, TResult>(
     IMultipleStoredProc <TRequest, TResult> sp,
     TRequest parameters)
 {
     return(QuerySharedBlock(sp, connection =>
     {
         var reader = connection.QueryMultiple(
             sp.StoredProcedureName,
             parameters,
             commandTimeout: sp.CommandTimeoutSecs,
             commandType: CommandType.StoredProcedure);
         return sp.Read(reader);
     }));
 }
 public TResult QueryMultiple <TRequest, TResult>(
     IMultipleStoredProc <TRequest, TResult> sp,
     TRequest parameters)
 {
     return(ExecuteCacheOrGet(sp, parameters, () => QueryMultipleImpl(sp, parameters)));
 }