@@ -69,18 +69,114 @@ public interface IRedisCollection<T> : IOrderedQueryable<T>, IAsyncEnumerable<T>
6969 /// <returns>Whether anything matching the expression was found.</returns>
7070 bool Any ( Expression < Func < T , bool > > expression ) ;
7171
72+ /// <summary>
73+ /// Updates the provided item in Redis. Document must have a property marked with the <see cref="RedisIdFieldAttribute"/>.
74+ /// </summary>
75+ /// <param name="item">The item to update.</param>
76+ void UpdateSync ( T item ) ;
77+
7278 /// <summary>
7379 /// Updates the provided item in Redis. Document must have a property marked with the <see cref="RedisIdFieldAttribute"/>.
7480 /// </summary>
7581 /// <param name="item">The item to update.</param>
7682 /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
7783 Task Update ( T item ) ;
7884
85+ /// <summary>
86+ /// Deletes the item from Redis.
87+ /// </summary>
88+ /// <param name="item">The item to be deleted.</param>
89+ void DeleteSync ( T item ) ;
90+
7991 /// <summary>
8092 /// Deletes the item from Redis.
8193 /// </summary>
8294 /// <param name="item">The item to be deleted.</param>
8395 /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
8496 Task Delete ( T item ) ;
97+
98+ /// <summary>
99+ /// Async method for enumerating the collection to a list.
100+ /// </summary>
101+ /// <returns>The enumerated collection as a list.</returns>
102+ Task < IList < T > > ToListAsync ( ) ;
103+
104+ /// <summary>
105+ /// Retrieves the count of the collection async.
106+ /// </summary>
107+ /// <returns>The Collection's count.</returns>
108+ Task < int > CountAsync ( ) ;
109+
110+ /// <summary>
111+ /// Retrieves the count of the collection async.
112+ /// </summary>
113+ /// <param name="expression">The predicate match.</param>
114+ /// <returns>The Collection's count.</returns>
115+ Task < int > CountAsync ( Expression < Func < T , bool > > expression ) ;
116+
117+ /// <summary>
118+ /// returns if there's any items in the colleciton.
119+ /// </summary>
120+ /// <returns>True if there are items present.</returns>
121+ Task < bool > AnyAsync ( ) ;
122+
123+ /// <summary>
124+ /// returns if there's any items in the colleciton.
125+ /// </summary>
126+ /// <returns>True if there are items present.</returns>
127+ /// <param name="expression">The predicate match.</param>
128+ Task < bool > AnyAsync ( Expression < Func < T , bool > > expression ) ;
129+
130+ /// <summary>
131+ /// Returns the first item asynchronously.
132+ /// </summary>
133+ /// <returns>First or default result.</returns>
134+ Task < T > FirstAsync ( ) ;
135+
136+ /// <summary>
137+ /// Returns the first item asynchronously.
138+ /// </summary>
139+ /// <param name="expression">The predicate match.</param>
140+ /// <returns>First or default result.</returns>
141+ Task < T > FirstAsync ( Expression < Func < T , bool > > expression ) ;
142+
143+ /// <summary>
144+ /// Returns the first or default asynchronously.
145+ /// </summary>
146+ /// <returns>First or default result.</returns>
147+ Task < T ? > FirstOrDefaultAsync ( ) ;
148+
149+ /// <summary>
150+ /// Returns the first or default asynchronously.
151+ /// </summary>
152+ /// <param name="expression">The predicate match.</param>
153+ /// <returns>First or default result.</returns>
154+ Task < T ? > FirstOrDefaultAsync ( Expression < Func < T , bool > > expression ) ;
155+
156+ /// <summary>
157+ /// Returns a single record or throws a <see cref="InvalidOperationException"/> if the sequence is empty or contains more than 1 record.
158+ /// </summary>
159+ /// <returns>The single instance.</returns>
160+ Task < T > SingleAsync ( ) ;
161+
162+ /// <summary>
163+ /// Returns a single record or throws a <see cref="InvalidOperationException"/> if the sequence is empty or contains more than 1 record.
164+ /// </summary>
165+ /// <param name="expression">The expression.</param>
166+ /// <returns>The single instance.</returns>
167+ Task < T > SingleAsync ( Expression < Func < T , bool > > expression ) ;
168+
169+ /// <summary>
170+ /// Returns a single record or the default if there are none, or more than 1.
171+ /// </summary>
172+ /// <returns>The single instance.</returns>
173+ Task < T ? > SingleOrDefaultAsync ( ) ;
174+
175+ /// <summary>
176+ /// Returns a single record or the default if there are none, or more than 1.
177+ /// </summary>
178+ /// <param name="expression">The expression.</param>
179+ /// <returns>The single instance.</returns>
180+ Task < T ? > SingleOrDefaultAsync ( Expression < Func < T , bool > > expression ) ;
85181 }
86182}
0 commit comments