Show / Hide Table of Contents

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
System.Collections.Generic.IEnumerable<T>.GetEnumerator()
System.Linq.IQueryable.ElementType
System.Linq.IQueryable.Expression
System.Linq.IQueryable.Provider
System.Collections.Generic.IAsyncEnumerable<T>.GetAsyncEnumerator(System.Threading.CancellationToken)
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 Source

ChunkSize

Gets the size of chunks to use when paginating.

Declaration
int ChunkSize { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

StateManager

Gets the collection state manager.

Declaration
RedisCollectionStateManager StateManager { get; }
Property Value
Type Description
RedisCollectionStateManager

Methods

| Improve this Doc View Source

Any(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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

Save()

Saves the current state of the collection, overriding what was initially materialized.

Declaration
void Save()
| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

Extension Methods

SearchExtensions.Where<T>(IRedisCollection<T>, Expression<Func<T, Boolean>>)
SearchExtensions.Select<T, TR>(IRedisCollection<T>, Expression<Func<T, TR>>)
SearchExtensions.Skip<T>(IRedisCollection<T>, Int32)
SearchExtensions.Take<T>(IRedisCollection<T>, Int32)
SearchExtensions.GeoFilter<T>(IRedisCollection<T>, Expression<Func<T, Nullable<GeoLoc>>>, Double, Double, Double, GeoLocDistanceUnit)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX