Exemplo n.º 1
0
		/// <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;
		}
Exemplo n.º 2
0
        /// <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;
        }
Exemplo n.º 3
0
 /// <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()));
 }
Exemplo n.º 4
0
 public TResult ExecuteCommand <TResult>(IScalarCommand <TResult> command)
 => _dbInvokerFactory.Create(command).Invoke(_dbManager);
Exemplo n.º 5
0
		/// <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;
		}
Exemplo n.º 6
0
 public IScalarCommandInvoker <TResult> Create <TResult>(IScalarCommand <TResult> serviceCommand)
 => new ScalarCommandInvoker <TResult>(serviceCommand);
Exemplo n.º 7
0
 internal ScalarCommandInvoker(IScalarCommand <TResult> command)
     : base(command)
 {
 }
Exemplo n.º 8
0
 /// <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;
 }
Exemplo n.º 9
0
		/// <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()));
		}