Interface IRedisCollection<T>
A collection of items in redis that you can use to look up items in redis, or perform queries on indexed documents.
Inherited Members
Namespace: Redis.OM.Searching
Assembly: Redis.OM.dll
Syntax
public interface IRedisCollection<T> : IOrderedQueryable<T>, IOrderedQueryable, IQueryable<T>, IEnumerable<T>, IQueryable, IEnumerable, IAsyncEnumerable<T>
Type Parameters
| Name | Description |
|---|---|
| T | The type. |
Properties
| Improve this Doc View SourceChunkSize
Gets the size of chunks to use when paginating.
Declaration
int ChunkSize { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
StateManager
Gets the collection state manager.
Declaration
RedisCollectionStateManager StateManager { get; }
Property Value
| Type | Description |
|---|---|
| RedisCollectionStateManager |
Methods
| Improve this Doc View SourceAny(Expression<Func<T, Boolean>>)
Checks to see if anything matching the expression exists.
Declaration
bool Any(Expression<Func<T, bool>> expression)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Linq.Expressions.Expression<System.Func<T, System.Boolean>> | expression | the expression to be matched. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Whether anything matching the expression was found. |
Delete(T)
Deletes the item from Redis.
Declaration
Task Delete(T item)
Parameters
| Type | Name | Description |
|---|---|---|
| T | item | The item to be deleted. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | A System.Threading.Tasks.Task representing the asynchronous operation. |
FindById(String)
finds an item by it's ID.
Declaration
T FindById(string id)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | id | the id to lookup. |
Returns
| Type | Description |
|---|---|
| T | the item if it's present. |
FindByIdAsync(String)
finds an item by it's ID.
Declaration
Task<T> FindByIdAsync(string id)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | id | the id to lookup. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<T> | the item if it's present. |
Insert(T)
Inserts an item into redis.
Declaration
string Insert(T item)
Parameters
| Type | Name | Description |
|---|---|---|
| T | item | an item. |
Returns
| Type | Description |
|---|---|
| System.String | the key. |
InsertAsync(T)
Inserts an item into redis.
Declaration
Task<string> InsertAsync(T item)
Parameters
| Type | Name | Description |
|---|---|---|
| T | item | an item. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.String> | the key. |
Save()
Saves the current state of the collection, overriding what was initially materialized.
Declaration
void Save()
SaveAsync()
Saves the current state of the collection, overriding what was initially materialized.
Declaration
ValueTask SaveAsync()
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.ValueTask | a value task. |
Update(T)
Updates the provided item in Redis. Document must have a property marked with the RedisIdFieldAttribute.
Declaration
Task Update(T item)
Parameters
| Type | Name | Description |
|---|---|---|
| T | item | The item to update. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | A System.Threading.Tasks.Task representing the asynchronous operation. |