コード例 #1
0
 public ValueTask <TResult> AsyncSyncCall <T1, T2, TResult>(Func <T1, T2, CancellationToken, ValueTask <TResult> > asyncCall, Func <T1, T2, TResult> syncCall, T1 arg1, T2 arg2)
 {
     return(IsAsync ? asyncCall(arg1, arg2, CancellationToken) : ValueTask2.FromResult(syncCall(arg1, arg2)));
 }
コード例 #2
0
 public ValueTask <TResult> AsyncSyncCallNoCancellation <TResult>(Func <ValueTask <TResult> > asyncCall, Func <TResult> syncCall)
 {
     return(IsAsync ? asyncCall() : ValueTask2.FromResult(syncCall()));
 }
コード例 #3
0
 public ValueTask <TResult> AsyncSyncCallNoCancellation <T1, TResult>(Func <T1, ValueTask <TResult> > asyncCall, Func <T1, TResult> syncCall, T1 arg1)
 {
     return(IsAsync ? asyncCall(arg1) : ValueTask2.FromResult(syncCall(arg1)));
 }
コード例 #4
0
 public ValueTask <bool> IsDBNull(AsyncWrappingCommonArgs async)
 {
     return(ValueTask2.FromResult(TypeHelper.IsDBNull(_value)));
 }
コード例 #5
0
 public ValueTask <TResult> AsyncSyncCall <TResult>(Func <CancellationToken, ValueTask <TResult> > asyncCall, Func <TResult> syncCall)
 {
     return(IsAsync ? asyncCall(CancellationToken) : ValueTask2.FromResult(syncCall()));
 }
コード例 #6
0
 public ValueTask <decimal> GetDecimal(AsyncWrappingCommonArgs async)
 {
     return(ValueTask2.FromResult(Convert.ToDecimal(_value, CultureInfo.InvariantCulture)));
 }
コード例 #7
0
 public ValueTask <float> GetFloat(AsyncWrappingCommonArgs async)
 {
     return(ValueTask2.FromResult(Convert.ToSingle(_value, CultureInfo.InvariantCulture)));
 }
コード例 #8
0
 public ValueTask <long> GetInt64(AsyncWrappingCommonArgs async)
 {
     return(ValueTask2.FromResult(Convert.ToInt64(_value, CultureInfo.InvariantCulture)));
 }
コード例 #9
0
 public ValueTask <byte> GetByte(AsyncWrappingCommonArgs async)
 {
     return(ValueTask2.FromResult(Convert.ToByte(_value, CultureInfo.InvariantCulture)));
 }
コード例 #10
0
 public ValueTask <char> GetChar(AsyncWrappingCommonArgs async)
 {
     return(ValueTask2.FromResult(Convert.ToChar(_value, CultureInfo.CurrentCulture)));
 }
 public readonly ValueTask <TResult> AsyncSyncCall <T1, TResult>(Func <T1, CancellationToken, ValueTask <TResult> > asyncCall, Func <T1, TResult> syncCall, T1 arg1)
 {
     return(_isAsync ? asyncCall(arg1, CancellationToken) : ValueTask2.FromResult(syncCall(arg1)));
 }
 public readonly ValueTask <TResult> AsyncSyncCallNoCancellation <T1, T2, T3, TResult>(Func <T1, T2, T3, ValueTask <TResult> > asyncCall, Func <T1, T2, T3, TResult> syncCall, T1 arg1, T2 arg2, T3 arg3)
 {
     return(_isAsync ? asyncCall(arg1, arg2, arg3) : ValueTask2.FromResult(syncCall(arg1, arg2, arg3)));
 }