/// <summary> /// Initializes a new instance. /// </summary> /// <param name="cmd">The command this instance will be associated with.</param> protected ScalarExecutor(IScalarCommand cmd) { if (cmd == null) throw new ArgumentNullException("command", "Command cannot be null."); if (cmd.IsDisposed) throw new ObjectDisposedException(cmd.ToString()); if (cmd.Link.IsDisposed) throw new ObjectDisposedException("Link '{0}' of command '{1}' is disposed.".FormatWith(cmd.Link, cmd)); _Command = cmd; }
/// <summary> /// Initializes a new instance. /// </summary> /// <param name="cmd">The command this instance will be associated with.</param> protected ScalarExecutor(IScalarCommand cmd) { if (cmd == null) { throw new ArgumentNullException("command", "Command cannot be null."); } if (cmd.IsDisposed) { throw new ObjectDisposedException(cmd.ToString()); } if (cmd.Link.IsDisposed) { throw new ObjectDisposedException("Link '{0}' of command '{1}' is disposed.".FormatWith(cmd.Link, cmd)); } _Command = cmd; }
/// <summary> /// Factory method invoked to create an executor to execute the given scalar command. /// </summary> /// <param name="command">The command to execute.</param> /// <returns>An executor able to execute de command.</returns> IScalarExecutor IDataLink.CreateScalarExecutor(IScalarCommand command) { throw new NotSupportedException( "Abstract IDataLink::{0}.CreateScalarExecutor(command) invoked." .FormatWith(GetType().EasyName())); }
public TResult ExecuteCommand <TResult>(IScalarCommand <TResult> command) => _dbInvokerFactory.Create(command).Invoke(_dbManager);
/// <summary> /// Invoked when disposing or finalizing this instance. /// </summary> /// <param name="disposing">True if the object is being disposed, false otherwise.</param> protected virtual void OnDispose(bool disposing) { _Command = null; _IsDisposed = true; }
public IScalarCommandInvoker <TResult> Create <TResult>(IScalarCommand <TResult> serviceCommand) => new ScalarCommandInvoker <TResult>(serviceCommand);
internal ScalarCommandInvoker(IScalarCommand <TResult> command) : base(command) { }
/// <summary> /// Invoked when disposing or finalizing this instance. /// </summary> /// <param name="disposing">True if the object is being disposed, false otherwise.</param> protected virtual void OnDispose(bool disposing) { _Command = null; _IsDisposed = true; }
/// <summary> /// Factory method invoked to create an executor to execute the given scalar command. /// </summary> /// <param name="command">The command to execute.</param> /// <returns>An executor able to execute de command.</returns> IScalarExecutor IDataLink.CreateScalarExecutor(IScalarCommand command) { throw new NotSupportedException( "Abstract IDataLink::{0}.CreateScalarExecutor(command) invoked." .FormatWith(GetType().EasyName())); }