示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SqlProjector"/> class.
        /// </summary>
        /// <param name="resolver">The handler resolver.</param>
        /// <param name="executor">The command executor.</param>
        /// <exception cref="System.ArgumentNullException">Thrown when <paramref name="resolver"/> or <paramref name="executor"/> is <c>null</c>.</exception>
        public SqlProjector(SqlProjectionHandlerResolver resolver, ISqlNonQueryCommandExecutor executor)
        {
            if (resolver == null) throw new ArgumentNullException("resolver");
            if (executor == null) throw new ArgumentNullException("executor");

            _resolver = resolver;
            _executor = executor;
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SqlProjector"/> class.
        /// </summary>
        /// <param name="resolver">The handler resolver.</param>
        /// <param name="executor">The command executor.</param>
        /// <exception cref="System.ArgumentNullException">Thrown when <paramref name="resolver"/> or <paramref name="executor"/> is <c>null</c>.</exception>
        public SqlProjector(SqlProjectionHandlerResolver resolver, ISqlNonQueryCommandExecutor executor)
        {
            if (resolver == null)
            {
                throw new ArgumentNullException("resolver");
            }
            if (executor == null)
            {
                throw new ArgumentNullException("executor");
            }

            _resolver = resolver;
            _executor = executor;
        }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SqlProjector"/> class.
 /// </summary>
 /// <param name="handlers">The handlers.</param>
 /// <param name="executor">The command executor.</param>
 /// <exception cref="System.ArgumentNullException">Thrown when <paramref name="handlers"/> or <paramref name="executor"/> is <c>null</c>.</exception>
 public SqlProjector(SqlProjectionHandler[] handlers, ISqlNonQueryCommandExecutor executor)
 {
     if (handlers == null)
     {
         throw new ArgumentNullException("handlers");
     }
     if (executor == null)
     {
         throw new ArgumentNullException("executor");
     }
     _handlers = handlers.
                 GroupBy(handler => handler.Message).
                 ToDictionary(@group => @group.Key, @group => @group.ToArray());
     _executor = executor;
 }
示例#4
0
 private static SqlProjector SutFactory(SqlProjectionHandler[] handlers, ISqlNonQueryCommandExecutor executor)
 {
     return(new SqlProjector(handlers, executor));
 }
示例#5
0
 private static SqlProjector SutFactory(ISqlNonQueryCommandExecutor executor)
 {
     return(SutFactory(new SqlProjectionHandler[0], executor));
 }
示例#6
0
 private static SqlProjector SutFactory(SqlProjectionHandlerResolver resolver, ISqlNonQueryCommandExecutor executor)
 {
     return new SqlProjector(resolver, executor);
 }
示例#7
0
 private static SqlProjector SutFactory(ISqlNonQueryCommandExecutor executor)
 {
     return SutFactory(Resolve.WhenEqualToHandlerMessageType(new SqlProjectionHandler[0]), executor);
 }
示例#8
0
 private static SqlProjector SutFactory(SqlProjectionHandlerResolver resolver, ISqlNonQueryCommandExecutor executor)
 {
     return(new SqlProjector(resolver, executor));
 }
示例#9
0
 private static SqlProjector SutFactory(ISqlNonQueryCommandExecutor executor)
 {
     return(SutFactory(Resolve.WhenEqualToHandlerMessageType(new SqlProjectionHandler[0]), executor));
 }