private TResult ExecuteWriteOperation <TResult>(IWriteOperation <TResult> operation) { using (var binding = _server.GetWriteBinding()) { return(operation.Execute(binding)); } }
protected TResult ExecuteOperation <TResult>(IWriteOperation <TResult> operation) { using (var binding = CoreTestConfiguration.GetReadWriteBinding()) { return(operation.Execute(binding, CancellationToken.None)); } }
private TResult ExecuteWriteOperation <TResult>(IWriteOperation <TResult> operation) { using (var binding = GetWriteBinding()) { return(operation.Execute(binding, CancellationToken.None)); } }
protected TResult ExecuteOperation <TResult>(IWriteOperation <TResult> operation) { using (var binding = CreateReadWriteBinding()) using (var bindingHandle = new ReadWriteBindingHandle(binding)) { return(operation.Execute(bindingHandle, CancellationToken.None)); } }
protected void VerifySessionIdWasSentWhenSupported <TResult>(IWriteOperation <TResult> operation, string commandName, bool async) { VerifySessionIdWasSentWhenSupported( (binding, cancellationToken) => operation.ExecuteAsync(binding, cancellationToken), (binding, cancellationToken) => operation.Execute(binding, cancellationToken), commandName, async); }
protected TResult ExecuteOperation <TResult>(IWriteOperation <TResult> operation) { using (var binding = CoreTestConfiguration.GetReadWriteBinding(_session.Fork())) using (var bindingHandle = new ReadWriteBindingHandle(binding)) { return(operation.Execute(bindingHandle, CancellationToken.None)); } }
protected TResult ExecuteOperation <TResult>(IWriteOperation <TResult> operation, bool useImplicitSession = false) { using (var binding = CreateReadWriteBinding(useImplicitSession)) using (var bindingHandle = new ReadWriteBindingHandle(binding)) { return(operation.Execute(bindingHandle, CancellationToken.None)); } }
protected TResult ExecuteOperation <TResult>(IWriteOperation <TResult> operation, IReadWriteBinding binding, bool async) { if (async) { return(operation.ExecuteAsync(binding, CancellationToken.None).GetAwaiter().GetResult()); } else { return(operation.Execute(binding, CancellationToken.None)); } }
/// <summary> /// Executes a write operation using a channel source. /// </summary> /// <typeparam name="TResult">The type of the result.</typeparam> /// <param name="operation">The write operation.</param> /// <param name="channelSource">The channel source.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>The result of the operation.</returns> public static TResult Execute <TResult>( this IWriteOperation <TResult> operation, IChannelSourceHandle channelSource, CancellationToken cancellationToken) { Ensure.IsNotNull(operation, nameof(operation)); using (var writeBinding = new ChannelSourceReadWriteBinding(channelSource.Fork(), ReadPreference.Primary)) { return(operation.Execute(writeBinding, cancellationToken)); } }
protected void VerifySessionIdWasNotSentIfUnacknowledgedWrite <TResult>( IWriteOperation <TResult> operation, string commandName, bool async, bool useImplicitSession) { VerifySessionIdSending( (binding, cancellationToken) => operation.ExecuteAsync(binding, cancellationToken), (binding, cancellationToken) => operation.Execute(binding, cancellationToken), AssertSessionIdWasNotSentIfUnacknowledgedWrite, commandName, async, useImplicitSession); }
private TResult ExecuteOperation <TResult>(IWriteOperation <TResult> operation, bool async) { using (var binding = CoreTestConfiguration.GetReadWriteBinding()) { if (async) { return(operation.ExecuteAsync(binding, CancellationToken.None).GetAwaiter().GetResult()); } else { return(operation.Execute(binding, CancellationToken.None)); } } }
public TResult ExecuteWriteOperation <TResult>(IWriteBinding binding, IWriteOperation <TResult> operation, CancellationToken cancellationToken) { return(operation.Execute(binding, cancellationToken)); }