Skip to content

Commit 3ed22ed

Browse files
committed
Async methods summaries
1 parent 5bc6942 commit 3ed22ed

29 files changed

Lines changed: 497 additions & 276 deletions

Extensions/Xtensive.Orm.BulkOperations/BulkExtensions.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2019-2020 Xtensive LLC.
1+
// Copyright (C) 2019-2020 Xtensive LLC.
22
// This code is distributed under MIT license terms.
33
// See the License.txt file in the project root for more information.
44

@@ -28,6 +28,9 @@ public static int Delete<T>(this IQueryable<T> query) where T : class, IEntity =
2828
/// <summary>
2929
/// Asynchronously executes bulk delete of entities specified by the query.
3030
/// </summary>
31+
/// <remarks>Multiple active operations in the same session instance are not supported. Use
32+
/// <see langword="await"/> to ensure that all asynchronous operations have completed before calling
33+
/// another method in this session.</remarks>
3134
/// <typeparam name="T">Type of the entity.</typeparam>
3235
/// <param name="query">The query.</param>
3336
/// <param name="token">The cancellation token to terminate execution if needed.</param>
@@ -105,6 +108,9 @@ public static int Update<T>(this IQueryable<T> query, Expression<Func<T, T>> eva
105108
/// <summary>
106109
/// Asynchronously executes the UPDATE operation.
107110
/// </summary>
111+
/// <remarks>Multiple active operations in the same session instance are not supported. Use
112+
/// <see langword="await"/> to ensure that all asynchronous operations have completed before calling
113+
/// another method in this session.</remarks>
108114
/// <typeparam name="T">Type of the entity.</typeparam>
109115
/// <param name="query">The query.</param>
110116
/// <param name="evaluator">The expression, that specify new values. Constructor parameters are ignored.</param>
@@ -126,6 +132,9 @@ public static int Update<T>(this IUpdatable<T> query) where T : class, IEntity =
126132
/// <summary>
127133
/// Asynchronously executes the UPDATE operation.
128134
/// </summary>
135+
/// <remarks>Multiple active operations in the same session instance are not supported. Use
136+
/// <see langword="await"/> to ensure that all asynchronous operations have completed before calling
137+
/// another method in this session.</remarks>
129138
/// <typeparam name="T">Type of the entity.</typeparam>
130139
/// <param name="query">The query.</param>
131140
/// <param name="token">The cancellation token to terminate execution if necessary.</param>
@@ -151,6 +160,9 @@ public static Key Insert<T>(this QueryEndpoint queryEndpoint, Expression<Func<T>
151160
/// <summary>
152161
/// Asynchronously executes INSERT operation.
153162
/// </summary>
163+
/// <remarks>Multiple active operations in the same session instance are not supported. Use
164+
/// <see langword="await"/> to ensure that all asynchronous operations have completed before calling
165+
/// another method in this session.</remarks>
154166
/// <typeparam name="T">Type of the entity.</typeparam>
155167
/// <param name="queryEndpoint">The query endpoint.</param>
156168
/// <param name="evaluator">The expression, tha specify new values.</param>

Orm/Xtensive.Orm/Core/AsyncFutureResult.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2014-2020 Xtensive LLC.
1+
// Copyright (C) 2014-2020 Xtensive LLC.
22
// This code is distributed under MIT license terms.
33
// See the License.txt file in the project root for more information.
44
// Created by: Denis Krjuchkov

Orm/Xtensive.Orm/Core/Extensions/EnumerableExtensions.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,8 @@ public static List<TValue> SortTopologically<TValue>(this IEnumerable<TValue> va
486486
/// <summary>
487487
/// Runs delayed query as async operation or returns enumerable as a task.
488488
/// </summary>
489+
/// <remarks>Multiple active operations are not supported. Use
490+
/// <see langword="await"/> to ensure that all asynchronous operations have completed.</remarks>
489491
/// <typeparam name="T">Type of items in sequence.</typeparam>
490492
/// <param name="source">Delayed query sequence or regular enumerable.</param>
491493
/// <returns>Task that runs delayed query or completed task with source.</returns>
@@ -496,6 +498,8 @@ public static Task<IEnumerable<T>> AsAsync<T>(this IEnumerable<T> source) =>
496498
/// <summary>
497499
/// Runs delayed query as async operation or returns enumerable as a task.
498500
/// </summary>
501+
/// <remarks>Multiple active operations are not supported. Use
502+
/// <see langword="await"/> to ensure that all asynchronous operations have completed.</remarks>
499503
/// <typeparam name="T">Type of items in sequence.</typeparam>
500504
/// <param name="source">Delayed query sequence or regular enumerable.</param>
501505
/// <param name="token">A token to cancel operation.</param>

Orm/Xtensive.Orm/Orm/DelayedQuery{T}.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ public sealed class DelayedQuery<TElement> : DelayedQuery, IEnumerable<TElement>
3030
/// <summary>
3131
/// Asynchronously executes delayed query.
3232
/// </summary>
33-
/// <param name="token">Cancellation token.</param>
34-
/// <returns>Value representing query execution result.</returns>
3533
/// <remarks>Multiple active operations in the same session instance are not supported. Use
36-
/// 'await' to ensure that any asynchronous operations have completed before calling
34+
/// <see langword="await"/> to ensure that all asynchronous operations have completed before calling
3735
/// another method in this session.</remarks>
36+
/// <param name="token">Cancellation token.</param>
37+
/// <returns>Value representing query execution result.</returns>
3838
public ValueTask<QueryResult<TElement>> ExecuteAsync(CancellationToken token = default) =>
3939
MaterializeAsync<TElement>(token);
4040

Orm/Xtensive.Orm/Orm/DelayedScalarQuery{T}.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,32 +31,32 @@ public sealed class DelayedScalarQuery<TResult> : DelayedQuery
3131
/// <summary>
3232
/// Asynchronously gets value.
3333
/// </summary>
34-
/// <returns>Task running this operation</returns>
3534
/// <remarks>Multiple active operations in the same session instance are not supported. Use
36-
/// 'await' to ensure that any asynchronous operations have completed before calling
35+
/// <see langword="await"/> to ensure that all asynchronous operations have completed before calling
3736
/// another method in this session.</remarks>
37+
/// <returns>Task running this operation</returns>
3838
[Obsolete("AsAsync Method is obsolete. Use ExecuteAsync method instead")]
3939
public Task<TResult> AsAsync() => AsAsync(CancellationToken.None);
4040

4141
/// <summary>
4242
/// Asynchronously gets value.
4343
/// </summary>
44-
/// <param name="token">Token to cancel operation.</param>
45-
/// <returns>Task running this operation.</returns>
4644
/// <remarks>Multiple active operations in the same session instance are not supported. Use
47-
/// 'await' to ensure that any asynchronous operations have completed before calling
45+
/// <see langword="await"/> to ensure that all asynchronous operations have completed before calling
4846
/// another method in this session.</remarks>
47+
/// <param name="token">Token to cancel operation.</param>
48+
/// <returns>Task running this operation.</returns>
4949
[Obsolete("AsAsync Method is obsolete. Use ExecuteAsync method instead")]
5050
public async Task<TResult> AsAsync(CancellationToken token) => await ExecuteAsync(token).ConfigureAwait(false);
5151

5252
/// <summary>
5353
/// Asynchronously executes delayed scalar query.
5454
/// </summary>
55-
/// <param name="token">Cancellation token.</param>
56-
/// <returns>Value representing scalar query execution result.</returns>
5755
/// <remarks>Multiple active operations in the same session instance are not supported. Use
58-
/// 'await' to ensure that any asynchronous operations have completed before calling
56+
/// <see langword="await"/> to ensure that all asynchronous operations have completed before calling
5957
/// another method in this session.</remarks>
58+
/// <param name="token">Cancellation token.</param>
59+
/// <returns>Value representing scalar query execution result.</returns>
6060
public async ValueTask<TResult> ExecuteAsync(CancellationToken token = default) =>
6161
(await MaterializeAsync<TResult>(token).ConfigureAwait(false)).ToScalar(resultAccessMethod);
6262

Orm/Xtensive.Orm/Orm/Linq/TranslatedQuery.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ public QueryResult<T> ExecuteSequence<T>(Session session, ParameterContext param
7676
/// <summary>
7777
/// Asynchronously executes the query in specified parameter context.
7878
/// </summary>
79+
/// <remarks> Multiple active operations are not supported. Use <see langword="await"/>
80+
/// to ensure that all asynchronous operations have completed.</remarks>
7981
/// <param name="session">The session.</param>
8082
/// <param name="parameterContext">The parameter context.</param>
8183
/// <param name="token">The token to cancel this operation</param>
@@ -90,6 +92,8 @@ public async Task<TResult> ExecuteScalarAsync<TResult>(
9092
/// <summary>
9193
/// Asynchronously executes the query in specified parameter context.
9294
/// </summary>
95+
/// <remarks> Multiple active operations are not supported. Use <see langword="await"/>
96+
/// to ensure that all asynchronous operations have completed.</remarks>
9397
/// <param name="session">The session.</param>
9498
/// <param name="parameterContext">The parameter context.</param>
9599
/// <param name="token">The token to cancel this operation</param>

Orm/Xtensive.Orm/Orm/PrefetchQuery.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,19 @@ public ExecuteAsyncResult(List<TElement> items, StrongReferenceContainer referen
6565
/// Asynchronously executes given <see cref="PrefetchQuery{TElement}"/> instance.
6666
/// </summary>
6767
/// <remarks>
68+
/// <para>
6869
/// This method internally puts all elements of the resulting sequence to a list
6970
/// and then it wraps mentioned list as a <see cref="QueryResult{TItem}"/>.
7071
/// As a consequence it is more efficient to use asynchronous enumeration over result of
7172
/// <see cref="AsAsyncEnumerable"/> method call because it can perform lazily
7273
/// not putting everything into intermediate list.
74+
/// </para>
75+
/// <para> Multiple active operations are not supported. Use <see langword="await"/>
76+
/// to ensure that all asynchronous operations have completed.
77+
/// </para>
7378
/// </remarks>
74-
/// <param name="token"></param>
75-
/// <returns></returns>
79+
/// <param name="token">The token to cancel operation if needed.</param>
80+
/// <returns>A task performing operation.</returns>
7681
public async Task<QueryResult<TElement>> ExecuteAsync(CancellationToken token = default)
7782
{
7883
var list = new List<TElement>();

Orm/Xtensive.Orm/Orm/Providers/CommandProcessing/CommandProcessor.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ public abstract class CommandProcessor
4646
/// Asynchronously executes all registered requests plus the specified one query.
4747
/// Default implementation is synchronous and returns complete task.
4848
/// </summary>
49+
/// <remarks> Multiple active operations are not supported. Use <see langword="await"/>
50+
/// to ensure that all asynchronous operations have completed.</remarks>
4951
/// <param name="request">The request to execute.</param>
5052
/// <param name="context">A contextual information to be used while executing
5153
/// the specified <paramref name="request"/>.</param>
@@ -72,6 +74,8 @@ public virtual Task<DataReader> ExecuteTasksWithReaderAsync(QueryRequest request
7274
/// <paramref name="context.AllowPartialExecution"/> argument.
7375
/// Default implementation executes requests synchronously and returns completed task.
7476
/// </summary>
77+
/// <remarks> Multiple active operations are not supported. Use <see langword="await"/>
78+
/// to ensure that all asynchronous operations have completed.</remarks>
7579
/// <param name="context">A contextual information to be used while executing
7680
/// registered query requests.</param>
7781
/// <param name="token">Token to cancel this operation</param>

Orm/Xtensive.Orm/Orm/Providers/Interfaces/IProviderExecutor.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ public interface IProviderExecutor
2929
/// <summary>
3030
/// Asynchronously executes the specified request.
3131
/// </summary>
32+
/// <remarks> Multiple active operations are not supported. Use <see langword="await"/>
33+
/// to ensure that all asynchronous operations have completed.</remarks>
3234
/// <param name="request">The request to execute.</param>
3335
/// <param name="parameterContext"><see cref="ParameterContext"/> instance with
3436
/// the values of query parameters.</param>

Orm/Xtensive.Orm/Orm/Providers/Interfaces/ISqlExecutor.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2012-2020 Xtensive LLC.
1+
// Copyright (C) 2012-2020 Xtensive LLC.
22
// This code is distributed under MIT license terms.
33
// See the License.txt file in the project root for more information.
44
// Created by: Denis Krjuchkov
@@ -28,6 +28,8 @@ public interface ISqlExecutor
2828
/// Asynchronously executes the specified query statement.
2929
/// This method is similar to <see cref="DbCommand.ExecuteReaderAsync()"/>.
3030
/// </summary>
31+
/// <remarks> Multiple active operations are not supported. Use <see langword="await"/>
32+
/// to ensure that all asynchronous operations have completed.</remarks>
3133
/// <param name="statement">The statement to execute.</param>
3234
/// <param name="token">The cancellation token to terminate execution if needed.</param>
3335
/// <returns>Result of execution.</returns>
@@ -60,6 +62,8 @@ public interface ISqlExecutor
6062
/// Asynchronously executes the specified scalar statement.
6163
/// This method is similar to <see cref="DbCommand.ExecuteScalarAsync()"/>.
6264
/// </summary>
65+
/// <remarks> Multiple active operations are not supported. Use <see langword="await"/>
66+
/// to ensure that all asynchronous operations have completed.</remarks>
6367
/// <param name="statement">The statement to execute.</param>
6468
/// <param name="token">The cancellation token to terminate execution if needed.</param>
6569
/// <returns>Result of execution.</returns>
@@ -76,6 +80,8 @@ public interface ISqlExecutor
7680
/// Asynchronously executes the specified scalar statement.
7781
/// This method is similar to <see cref="DbCommand.ExecuteScalarAsync()"/>.
7882
/// </summary>
83+
/// <remarks> Multiple active operations are not supported. Use <see langword="await"/>
84+
/// to ensure that all asynchronous operations have completed.</remarks>
7985
/// <param name="commandText">The statement to execute.</param>
8086
/// <param name="token">The cancellation token to terminate execution if needed.</param>
8187
/// <returns>Result of execution.</returns>
@@ -92,6 +98,8 @@ public interface ISqlExecutor
9298
/// Asynchronously executes the specified non query statement.
9399
/// This method is similar to <see cref="DbCommand.ExecuteNonQueryAsync()"/>.
94100
/// </summary>
101+
/// <remarks> Multiple active operations are not supported. Use <see langword="await"/>
102+
/// to ensure that all asynchronous operations have completed.</remarks>
95103
/// <param name="statement">The statement to execute.</param>
96104
/// <param name="token">The cancellation token to terminate execution if needed.</param>
97105
/// <returns>Result of execution.</returns>
@@ -108,6 +116,8 @@ public interface ISqlExecutor
108116
/// Asynchronously executes the specified non query statement.
109117
/// This method is similar to <see cref="DbCommand.ExecuteNonQueryAsync()"/>.
110118
/// </summary>
119+
/// <remarks> Multiple active operations are not supported. Use <see langword="await"/>
120+
/// to ensure that all asynchronous operations have completed.</remarks>
111121
/// <param name="commandText">The statement to execute.</param>
112122
/// <param name="token">The cancellation token to terminate execution if needed.</param>
113123
/// <returns>Result of execution.</returns>
@@ -123,6 +133,8 @@ public interface ISqlExecutor
123133
/// Asynchronously executes group of DDL statements
124134
/// via <see cref="ExecuteNonQueryAsync(System.String, System.Threading.CancellationToken)"/>.
125135
/// </summary>
136+
/// <remarks> Multiple active operations are not supported. Use <see langword="await"/>
137+
/// to ensure that all asynchronous operations have completed.</remarks>
126138
/// <param name="token">The cancellation token to terminate execution if needed.</param>
127139
/// <param name="statements">Statements to execute</param>
128140
Task ExecuteManyAsync(IEnumerable<string> statements, CancellationToken token = default);
@@ -137,6 +149,8 @@ public interface ISqlExecutor
137149
/// <summary>
138150
/// Asynchronously executes the specified extraction tasks.
139151
/// </summary>
152+
/// <remarks> Multiple active operations are not supported. Use <see langword="await"/>
153+
/// to ensure that all asynchronous operations have completed.</remarks>
140154
/// <param name="tasks">Tasks to execute.</param>
141155
/// <param name="token">The cancellation token to terminate execution if needed.</param>
142156
/// <returns>Extraction result.</returns>

0 commit comments

Comments
 (0)