/// <summary> /// Initializes a new instance of the <see cref="AsyncRedisProjector"/> class. /// </summary> /// <param name="handlers">The handlers.</param> /// <exception cref="System.ArgumentNullException">Thrown when <paramref name="handlers"/> is <c>null</c>.</exception> public AsyncRedisProjector(RedisProjectionHandler[] handlers) { if (handlers == null) throw new ArgumentNullException("handlers"); _handlers = handlers. GroupBy(handler => handler.Message). ToDictionary(@group => @group.Key, @group => @group.ToArray()); }
/// <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="RedisProjection"/> containing the concatenated handlers.</returns> /// <exception cref="System.ArgumentNullException">Thrown when <paramref name="handlers"/> are <c>null</c>.</exception> public RedisProjection Concat(RedisProjectionHandler[] handlers) { if (handlers == null) { throw new ArgumentNullException("handlers"); } var concatenated = new RedisProjectionHandler[Handlers.Length + handlers.Length]; Handlers.CopyTo(concatenated, 0); handlers.CopyTo(concatenated, Handlers.Length); return(new RedisProjection(concatenated)); }
/// <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="RedisProjection"/> containing the concatenated handlers.</returns> /// <exception cref="System.ArgumentNullException">Thrown when <paramref name="handler"/> is <c>null</c>.</exception> public RedisProjection Concat(RedisProjectionHandler handler) { if (handler == null) { throw new ArgumentNullException("handler"); } var concatenated = new RedisProjectionHandler[Handlers.Length + 1]; Handlers.CopyTo(concatenated, 0); concatenated[Handlers.Length] = handler; return(new RedisProjection(concatenated)); }