Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AsyncElasticsearchProjector"/> class.
 /// </summary>
 /// <param name="handlers">The handlers.</param>
 /// <exception cref="System.ArgumentNullException">Thrown when <paramref name="handlers"/> is <c>null</c>.</exception>
 public AsyncElasticsearchProjector(ElasticsearchProjectionHandler[] handlers)
 {
     if (handlers == null) throw new ArgumentNullException("handlers");
     _handlers = handlers.
         GroupBy(handler => handler.Message).
         ToDictionary(@group => @group.Key, @group => @group.ToArray());
 }
Ejemplo n.º 2
0
        /// <summary>
        ///     Concatenates the handlers of this projection with the specified projection handler.
        /// </summary>
        /// <param name="handler">The projection handler to concatenate.</param>
        /// <returns>A <see cref="ElasticsearchProjection"/> containing the concatenated handlers.</returns>
        /// <exception cref="System.ArgumentNullException">Thrown when <paramref name="handler"/> is <c>null</c>.</exception>
        public ElasticsearchProjection Concat(ElasticsearchProjectionHandler handler)
        {
            if (handler == null)
                throw new ArgumentNullException("handler");

            var concatenated = new ElasticsearchProjectionHandler[Handlers.Length + 1];
            Handlers.CopyTo(concatenated, 0);
            concatenated[Handlers.Length] = handler;
            return new ElasticsearchProjection(concatenated);
        }
Ejemplo n.º 3
0
        /// <summary>
        ///     Concatenates the handlers of this projection with the specified projection handlers.
        /// </summary>
        /// <param name="handlers">The projection handlers to concatenate.</param>
        /// <returns>A <see cref="ElasticsearchProjection"/> containing the concatenated handlers.</returns>
        /// <exception cref="System.ArgumentNullException">Thrown when <paramref name="handlers"/> are <c>null</c>.</exception>
        public ElasticsearchProjection Concat(ElasticsearchProjectionHandler[] handlers)
        {
            if (handlers == null)
            {
                throw new ArgumentNullException("handlers");
            }

            var concatenated = new ElasticsearchProjectionHandler[Handlers.Length + handlers.Length];

            Handlers.CopyTo(concatenated, 0);
            handlers.CopyTo(concatenated, Handlers.Length);
            return(new ElasticsearchProjection(concatenated));
        }
Ejemplo n.º 4
0
        /// <summary>
        ///     Concatenates the handlers of this projection with the specified projection handler.
        /// </summary>
        /// <param name="handler">The projection handler to concatenate.</param>
        /// <returns>A <see cref="ElasticsearchProjection"/> containing the concatenated handlers.</returns>
        /// <exception cref="System.ArgumentNullException">Thrown when <paramref name="handler"/> is <c>null</c>.</exception>
        public ElasticsearchProjection Concat(ElasticsearchProjectionHandler handler)
        {
            if (handler == null)
            {
                throw new ArgumentNullException("handler");
            }

            var concatenated = new ElasticsearchProjectionHandler[Handlers.Length + 1];

            Handlers.CopyTo(concatenated, 0);
            concatenated[Handlers.Length] = handler;
            return(new ElasticsearchProjection(concatenated));
        }
Ejemplo n.º 5
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="ElasticsearchProjection" /> class.
 /// </summary>
 /// <param name="handlers">The handlers.</param>
 /// <exception cref="System.ArgumentNullException">Thrown when <paramref name="handlers" /> are <c>null</c>.</exception>
 public ElasticsearchProjection(ElasticsearchProjectionHandler[] handlers)
 {
     if (handlers == null) throw new ArgumentNullException("handlers");
     _handlers = handlers;
 }
Ejemplo n.º 6
0
        /// <summary>
        ///     Concatenates the handlers of this projection with the specified projection handlers.
        /// </summary>
        /// <param name="handlers">The projection handlers to concatenate.</param>
        /// <returns>A <see cref="ElasticsearchProjection"/> containing the concatenated handlers.</returns>
        /// <exception cref="System.ArgumentNullException">Thrown when <paramref name="handlers"/> are <c>null</c>.</exception>
        public ElasticsearchProjection Concat(ElasticsearchProjectionHandler[] handlers)
        {
            if (handlers == null)
                throw new ArgumentNullException("handlers");

            var concatenated = new ElasticsearchProjectionHandler[Handlers.Length + handlers.Length];
            Handlers.CopyTo(concatenated, 0);
            handlers.CopyTo(concatenated, Handlers.Length);
            return new ElasticsearchProjection(concatenated);
        }