Skip to content

Commit 34deb5f

Browse files
authored
Reintroduce obsoleted methods (#650)
1 parent fd8e41b commit 34deb5f

File tree

5 files changed

+0
-36
lines changed

5 files changed

+0
-36
lines changed

src/YesSql.Abstractions/IIdGenerator.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ public interface IIdGenerator
2020
/// Invoked when the underlying store is created.
2121
/// </summary>
2222
/// <param name="store">The store that this <see cref="IIdGenerator"/> instance is assigned to.</param>
23-
[Obsolete($"Instead, utilize the {nameof(InitializeAsync)} method with a CancellationToken parameter. This current method is slated for removal in upcoming releases.")]
2423
Task InitializeAsync(IStore store);
2524

2625
/// <summary>
@@ -31,15 +30,13 @@ public interface IIdGenerator
3130
/// <summary>
3231
/// Initializes a document collection.
3332
/// </summary>
34-
[Obsolete($"Instead, utilize the {nameof(InitializeCollectionAsync)} method with a CancellationToken parameter. This current method is slated for removal in upcoming releases.")]
3533
Task InitializeCollectionAsync(IConfiguration configuration, string collection);
3634

3735
/// <summary>
3836
/// Generates a unique identifier for the store.
3937
/// </summary>
4038
/// <param name="collection">The name of the collection to generate the identifier for.</param>
4139
/// <returns>A unique identifier</returns>
42-
[Obsolete($"Instead, utilize the {nameof(GetNextIdAsync)} method. This current method is slated for removal in upcoming releases.")]
4340
long GetNextId(string collection);
4441

4542
/// <summary>
@@ -55,7 +52,6 @@ public interface IIdGenerator
5552
/// </summary>
5653
/// <param name="collection">The name of the collection to generate the identifier for.</param>
5754
/// <returns>A unique identifier</returns>
58-
[Obsolete($"Instead, utilize the {nameof(GetNextIdAsync)} method with a CancellationToken parameter. This current method is slated for removal in upcoming releases.")]
5955
Task<long> GetNextIdAsync(string collection);
6056
}
6157
}

src/YesSql.Abstractions/IQuery.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ public interface IQuery<T> where T : class
9191
/// <summary>
9292
/// Executes the query and returns the first result matching the constraints.
9393
/// </summary>
94-
[Obsolete($"Instead, utilize the {nameof(FirstOrDefaultAsync)} method with a CancellationToken parameter. This current method is slated for removal in upcoming releases.")]
9594
Task<T> FirstOrDefaultAsync();
9695

9796
/// <summary>
@@ -102,7 +101,6 @@ public interface IQuery<T> where T : class
102101
/// <summary>
103102
/// Executes the query and returns all documents matching the constraints.
104103
/// </summary>
105-
[Obsolete($"Instead, utilize the {nameof(ListAsync)} method with a CancellationToken parameter. This current method is slated for removal in upcoming releases.")]
106104
Task<IEnumerable<T>> ListAsync();
107105

108106
/// <summary>
@@ -113,7 +111,6 @@ public interface IQuery<T> where T : class
113111
/// <summary>
114112
/// Executes the query and returns all documents matching the constraints.
115113
/// </summary>
116-
[Obsolete($"Instead, utilize the {nameof(ToAsyncEnumerable)} method with a CancellationToken parameter. This current method is slated for removal in upcoming releases.")]
117114
IAsyncEnumerable<T> ToAsyncEnumerable();
118115

119116
/// <summary>
@@ -124,7 +121,6 @@ public interface IQuery<T> where T : class
124121
/// <summary>
125122
/// Executes a that returns the number of documents matching the constraints.
126123
/// </summary>
127-
[Obsolete($"Instead, utilize the {nameof(CountAsync)} method with a CancellationToken parameter. This current method is slated for removal in upcoming releases.")]
128124
Task<int> CountAsync();
129125

130126
/// <summary>
@@ -214,7 +210,6 @@ public interface IQueryIndex<T> where T : IIndex
214210
/// <summary>
215211
/// Returns the first result only, if it exists.
216212
/// </summary>
217-
[Obsolete($"Instead, utilize the {nameof(FirstOrDefaultAsync)} method with a CancellationToken parameter. This current method is slated for removal in upcoming releases.")]
218213
Task<T> FirstOrDefaultAsync();
219214

220215
/// <summary>
@@ -225,7 +220,6 @@ public interface IQueryIndex<T> where T : IIndex
225220
/// <summary>
226221
/// Executes the query.
227222
/// </summary>
228-
[Obsolete($"Instead, utilize the {nameof(ListAsync)} method with a CancellationToken parameter. This current method is slated for removal in upcoming releases.")]
229223
Task<IEnumerable<T>> ListAsync();
230224

231225
/// <summary>
@@ -238,7 +232,6 @@ public interface IQueryIndex<T> where T : IIndex
238232
/// Executes the query for asynchronous iteration.
239233
/// </summary>
240234
/// <returns></returns>
241-
[Obsolete($"Instead, utilize the {nameof(ToAsyncEnumerable)} method with a CancellationToken parameter. This current method is slated for removal in upcoming releases.")]
242235
IAsyncEnumerable<T> ToAsyncEnumerable();
243236

244237
/// <summary>
@@ -249,7 +242,6 @@ public interface IQueryIndex<T> where T : IIndex
249242
/// <summary>
250243
/// Returns the number of results only.
251244
/// </summary>
252-
[Obsolete($"Instead, utilize the {nameof(CountAsync)} method with a CancellationToken parameter. This current method is slated for removal in upcoming releases.")]
253245
Task<int> CountAsync();
254246
}
255247

src/YesSql.Abstractions/ISchemaBuilder.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,67 +43,56 @@ public interface ISchemaBuilder
4343
/// <summary>
4444
/// Alters an existing table.
4545
/// </summary>
46-
[Obsolete($"Instead, utilize the {nameof(AlterTableAsync)} method. This current method is slated for removal in upcoming releases.")]
4746
ISchemaBuilder AlterTable(string name, Action<IAlterTableCommand> table);
4847

4948
/// <summary>
5049
/// Alters an index table.
5150
/// </summary>
52-
[Obsolete($"Instead, utilize the {nameof(AlterIndexTableAsync)} method. This current method is slated for removal in upcoming releases.")]
5351
ISchemaBuilder AlterIndexTable(Type indexType, Action<IAlterTableCommand> table, string collection);
5452

5553
/// <summary>
5654
/// Creates a foreign key.
5755
/// </summary>
58-
[Obsolete($"Instead, utilize the {nameof(CreateForeignKeyAsync)} method. This current method is slated for removal in upcoming releases.")]
5956
ISchemaBuilder CreateForeignKey(string name, string srcTable, string[] srcColumns, string destTable, string[] destColumns);
6057

6158
/// <summary>
6259
/// Creates a Map Index table.
6360
/// </summary>
64-
[Obsolete($"Instead, utilize the {nameof(CreateMapIndexTableAsync)} method. This current method is slated for removal in upcoming releases.")]
6561
ISchemaBuilder CreateMapIndexTable(Type indexType, Action<ICreateTableCommand> table, string collection);
6662

6763
/// <summary>
6864
/// Creates a Reduce Index table.
6965
/// </summary>
70-
[Obsolete($"Instead, utilize the {nameof(CreateReduceIndexTableAsync)} method. This current method is slated for removal in upcoming releases.")]
7166
ISchemaBuilder CreateReduceIndexTable(Type indexType, Action<ICreateTableCommand> table, string collection);
7267

7368
/// <summary>
7469
/// Creates a table.
7570
/// </summary>
76-
[Obsolete($"Instead, utilize the {nameof(CreateTableAsync)} method. This current method is slated for removal in upcoming releases.")]
7771
ISchemaBuilder CreateTable(string name, Action<ICreateTableCommand> table);
7872

7973
/// <summary>
8074
/// Removes a foreign key.
8175
/// </summary>
82-
[Obsolete($"Instead, utilize the {nameof(DropForeignKeyAsync)} method. This current method is slated for removal in upcoming releases.")]
8376
ISchemaBuilder DropForeignKey(string srcTable, string name);
8477

8578
/// <summary>
8679
/// Removes a Map Index table.
8780
/// </summary>
88-
[Obsolete($"Instead, utilize the {nameof(DropMapIndexTableAsync)} method. This current method is slated for removal in upcoming releases.")]
8981
ISchemaBuilder DropMapIndexTable(Type indexType, string collection = null);
9082

9183
/// <summary>
9284
/// Removes a Reduce Index table.
9385
/// </summary>
94-
[Obsolete($"Instead, utilize the {nameof(DropReduceIndexTableAsync)} method. This current method is slated for removal in upcoming releases.")]
9586
ISchemaBuilder DropReduceIndexTable(Type indexType, string collection = null);
9687

9788
/// <summary>
9889
/// Removes a table.
9990
/// </summary>
100-
[Obsolete($"Instead, utilize the {nameof(DropTableAsync)} method. This current method is slated for removal in upcoming releases.")]
10191
ISchemaBuilder DropTable(string name);
10292

10393
/// <summary>
10494
/// Creates a database schema.
10595
/// </summary>
106-
[Obsolete($"Instead, utilize the {nameof(CreateSchemaAsync)} method. This current method is slated for removal in upcoming releases.")]
10796
ISchemaBuilder CreateSchema(string schema);
10897

10998

src/YesSql.Abstractions/ISession.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ public interface ISession : IDisposable, IAsyncDisposable
2020
/// <param name="obj">The entity to save.</param>
2121
/// <param name="checkConcurrency">If true, a <see cref="ConcurrencyException"/> is thrown if the entity has been updated concurrently by another session.</param>
2222
/// <param name="collection">The name of the collection to store the object in.</param>
23-
[Obsolete($"Instead, utilize the {nameof(SaveAsync)} method. This current method is slated for removal in upcoming releases.")]
2423
void Save(object obj, bool checkConcurrency = false, string collection = null);
2524

2625

@@ -41,7 +40,6 @@ public interface ISession : IDisposable, IAsyncDisposable
4140
/// <param name="obj">The entity to save.</param>
4241
/// <param name="checkConcurrency">If true, a <see cref="ConcurrencyException"/> is thrown if the entity has been updated concurrently by another session.</param>
4342
/// <param name="collection">The name of the collection to store the object in.</param>
44-
[Obsolete($"Instead, utilize the {nameof(SaveAsync)} method with a CancellationToken parameter. This current method is slated for removal in upcoming releases.")]
4543
Task SaveAsync(object obj, bool checkConcurrency, string collection);
4644

4745
/// <summary>
@@ -50,15 +48,13 @@ public interface ISession : IDisposable, IAsyncDisposable
5048
/// </summary>
5149
/// <param name="obj">The entity to save.</param>
5250
/// <param name="checkConcurrency">If true, a <see cref="ConcurrencyException"/> is thrown if the entity has been updated concurrently by another session.</param>
53-
[Obsolete($"Instead, utilize the {nameof(SaveAsync)} method with a CancellationToken parameter. This current method is slated for removal in upcoming releases.")]
5451
Task SaveAsync(object obj, bool checkConcurrency);
5552

5653
/// <summary>
5754
/// Saves a new or existing object to the store, and updates
5855
/// the corresponding indexes.
5956
/// </summary>
6057
/// <param name="obj">The entity to save.</param>
61-
[Obsolete($"Instead, utilize the {nameof(SaveAsync)} method with a CancellationToken parameter. This current method is slated for removal in upcoming releases.")]
6258
Task SaveAsync(object obj);
6359

6460
/// <summary>
@@ -115,14 +111,12 @@ public interface ISession : IDisposable, IAsyncDisposable
115111
/// Loads objects by id.
116112
/// </summary>
117113
/// <returns>A collection of objects in the same order they were defined.</returns>
118-
[Obsolete($"Instead, utilize the {nameof(GetAsync)} method with a CancellationToken parameter. This current method is slated for removal in upcoming releases.")]
119114
Task<IEnumerable<T>> GetAsync<T>(long[] ids, string collection) where T : class;
120115

121116
/// <summary>
122117
/// Loads objects by id.
123118
/// </summary>
124119
/// <returns>A collection of objects in the same order they were defined.</returns>
125-
[Obsolete($"Instead, utilize the {nameof(GetAsync)} method with a CancellationToken parameter. This current method is slated for removal in upcoming releases.")]
126120
Task<IEnumerable<T>> GetAsync<T>(long[] ids) where T : class;
127121

128122
/// <summary>
@@ -168,7 +162,6 @@ public interface ISession : IDisposable, IAsyncDisposable
168162
/// This doesn't commit or dispose of the transaction. A call to <see cref="SaveChangesAsync(CancellationToken)"/>
169163
/// is still necessary for the changes to be visible from other transactions.
170164
/// </remarks>
171-
[Obsolete($"Instead, utilize the {nameof(FlushAsync)} method with a CancellationToken parameter. This current method is slated for removal in upcoming releases.")]
172165
Task FlushAsync();
173166

174167
/// <summary>
@@ -187,7 +180,6 @@ public interface ISession : IDisposable, IAsyncDisposable
187180
/// Sessions are not automatically committed when disposed, and <see cref="SaveChangesAsync(CancellationToken)"/>
188181
/// must be called before disposing the <see cref="ISession"/>
189182
/// </remarks>
190-
[Obsolete($"Instead, utilize the {nameof(SaveChangesAsync)} method with a CancellationToken parameter. This current method is slated for removal in upcoming releases.")]
191183
Task SaveChangesAsync();
192184

193185
/// <summary>
@@ -198,7 +190,6 @@ public interface ISession : IDisposable, IAsyncDisposable
198190
/// <summary>
199191
/// Creates or returns a <see cref="DbConnection"/>.
200192
/// </summary>
201-
[Obsolete($"Instead, utilize the {nameof(CreateConnectionAsync)} method with a CancellationToken parameter. This current method is slated for removal in upcoming releases.")]
202193
Task<DbConnection> CreateConnectionAsync();
203194

204195
/// <summary>
@@ -209,7 +200,6 @@ public interface ISession : IDisposable, IAsyncDisposable
209200
/// <summary>
210201
/// Creates or returns an existing <see cref="DbTransaction"/> with the default isolation level.
211202
/// </summary>
212-
[Obsolete($"Instead, utilize the {nameof(BeginTransactionAsync)} method with a CancellationToken parameter. This current method is slated for removal in upcoming releases.")]
213203
Task<DbTransaction> BeginTransactionAsync();
214204

215205
/// <summary>
@@ -220,7 +210,6 @@ public interface ISession : IDisposable, IAsyncDisposable
220210
/// <summary>
221211
/// Creates or returns an existing <see cref="DbTransaction"/> with the specified isolation level.
222212
/// </summary>
223-
[Obsolete($"Instead, utilize the {nameof(BeginTransactionAsync)} method with a CancellationToken parameter. This current method is slated for removal in upcoming releases.")]
224213
Task<DbTransaction> BeginTransactionAsync(IsolationLevel isolationLevel);
225214

226215
/// <summary>

src/YesSql.Abstractions/IStore.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ public interface IStore : IDisposable
3434
/// <summary>
3535
/// Initializes the database by creating the required tables and the default collection if necessary.
3636
/// </summary>
37-
[Obsolete($"Instead, utilize the {nameof(InitializeAsync)} method with a CancellationToken parameter. This current method is slated for removal in upcoming releases.")]
3837
Task InitializeAsync();
3938

4039
/// <summary>
@@ -45,7 +44,6 @@ public interface IStore : IDisposable
4544
/// <summary>
4645
/// Initializes a collection in the database by creating the required tables if necessary.
4746
/// </summary>
48-
[Obsolete($"Instead, utilize the {nameof(InitializeCollectionAsync)} method with a CancellationToken parameter. This current method is slated for removal in upcoming releases.")]
4947
Task InitializeCollectionAsync(string collection);
5048

5149
/// <summary>

0 commit comments

Comments
 (0)