|
| 1 | +using Redis.OM.Aggregation; |
| 2 | +using Redis.OM.Searching; |
| 3 | + |
| 4 | +namespace Redis.OM.Contracts |
| 5 | +{ |
| 6 | + /// <summary> |
| 7 | + /// Provides a connection to redis. |
| 8 | + /// </summary> |
| 9 | + public interface IRedisConnectionProvider |
| 10 | + { |
| 11 | + /// <summary> |
| 12 | + /// Gets a command level interface to redis. |
| 13 | + /// </summary> |
| 14 | + IRedisConnection Connection { get; } |
| 15 | + |
| 16 | + /// <summary> |
| 17 | + /// Gets an aggregation set for redis. |
| 18 | + /// </summary> |
| 19 | + /// <typeparam name="T">The indexed type to run aggregations on.</typeparam> |
| 20 | + /// <param name="chunkSize">Size of chunks to use during pagination, larger chunks = larger payloads returned but fewer round trips.</param> |
| 21 | + /// <returns>the aggregation set.</returns> |
| 22 | + RedisAggregationSet<T> AggregationSet<T>(int chunkSize = 100); |
| 23 | + |
| 24 | + /// <summary> |
| 25 | + /// Gets a redis collection. |
| 26 | + /// </summary> |
| 27 | + /// <typeparam name="T">The type the collection will be retrieving.</typeparam> |
| 28 | + /// <param name="chunkSize">Size of chunks to use during pagination, larger chunks = larger payloads returned but fewer round trips.</param> |
| 29 | + /// <returns>A RedisCollection.</returns> |
| 30 | + IRedisCollection<T> RedisCollection<T>(int chunkSize = 100) |
| 31 | + where T : notnull; |
| 32 | + |
| 33 | + /// <summary> |
| 34 | + /// Gets a redis collection. |
| 35 | + /// </summary> |
| 36 | + /// <typeparam name="T">The type the collection will be retrieving.</typeparam> |
| 37 | + /// <param name="saveState">Whether or not the RedisCollection should maintain the state of documents it enumerates.</param> |
| 38 | + /// <param name="chunkSize">Size of chunks to use during pagination, larger chunks = larger payloads returned but fewer round trips.</param> |
| 39 | + /// <returns>A RedisCollection.</returns> |
| 40 | + IRedisCollection<T> RedisCollection<T>(bool saveState, int chunkSize = 100) |
| 41 | + where T : notnull; |
| 42 | + } |
| 43 | +} |
0 commit comments