Skip to content

Commit 9946be9

Browse files
author
Vadim Belov
committed
Update XML docs to use discard param names and clarify types
Replaced unused parameter names with discards (`_`, `__`) in `Unit` and updated XML docs to refer generically to parameters. Also revised `Mediator` documentation to use non-generic type references for clarity.
1 parent e54e049 commit 9946be9

2 files changed

Lines changed: 27 additions & 27 deletions

File tree

Sources/EasyExtensions.Mediator/Contracts/Unit.cs

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,28 @@ namespace EasyExtensions.Mediator.Contracts
2323
/// <summary>
2424
/// Compares the current object with another object of the same type.
2525
/// </summary>
26-
/// <param name="other">An object to compare with this object.</param>
26+
/// <param name="_">An object to compare with this object.</param>
2727
/// <returns>
2828
/// A value that indicates the relative order of the objects being compared.
2929
/// The return value has the following meanings:
30-
/// - Less than zero: This object is less than the <paramref name="other" /> parameter.
31-
/// - Zero: This object is equal to <paramref name="other" />.
32-
/// - Greater than zero: This object is greater than <paramref name="other" />.
30+
/// - Less than zero: This object is less than the parameter.
31+
/// - Zero: This object is equal to the parameter.
32+
/// - Greater than zero: This object is greater than the parameter.
3333
/// </returns>
34-
public int CompareTo(Unit other) => 0;
34+
public int CompareTo(Unit _) => 0;
3535

3636
/// <summary>
3737
/// Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
3838
/// </summary>
39-
/// <param name="obj">An object to compare with this instance.</param>
39+
/// <param name="_">An object to compare with this instance.</param>
4040
/// <returns>
4141
/// A value that indicates the relative order of the objects being compared.
4242
/// The return value has these meanings:
43-
/// - Less than zero: This instance precedes <paramref name="obj" /> in the sort order.
44-
/// - Zero: This instance occurs in the same position in the sort order as <paramref name="obj" />.
45-
/// - Greater than zero: This instance follows <paramref name="obj" /> in the sort order.
43+
/// - Less than zero: This instance precedes the object in the sort order.
44+
/// - Zero: This instance occurs in the same position in the sort order as the object.
45+
/// - Greater than zero: This instance follows the object in the sort order.
4646
/// </returns>
47-
int IComparable.CompareTo(object? obj) => 0;
47+
int IComparable.CompareTo(object? _) => 0;
4848

4949
/// <summary>
5050
/// Returns a hash code for this instance.
@@ -57,11 +57,11 @@ namespace EasyExtensions.Mediator.Contracts
5757
/// <summary>
5858
/// Determines whether the current object is equal to another object of the same type.
5959
/// </summary>
60-
/// <param name="other">An object to compare with this object.</param>
60+
/// <param name="_">An object to compare with this object.</param>
6161
/// <returns>
62-
/// <c>true</c> if the current object is equal to the <paramref name="other" /> parameter; otherwise, <c>false</c>.
62+
/// <c>true</c> if the current object is equal to the parameter; otherwise, <c>false</c>.
6363
/// </returns>
64-
public bool Equals(Unit other) => true;
64+
public bool Equals(Unit _) => true;
6565

6666
/// <summary>
6767
/// Determines whether the specified <see cref="System.Object" /> is equal to this instance.
@@ -73,20 +73,20 @@ namespace EasyExtensions.Mediator.Contracts
7373
public override bool Equals(object? obj) => obj is Unit;
7474

7575
/// <summary>
76-
/// Determines whether the <paramref name="first"/> object is equal to the <paramref name="second"/> object.
76+
/// Determines whether the first object is equal to the second object.
7777
/// </summary>
78-
/// <param name="first">The first object.</param>
79-
/// <param name="second">The second object.</param>
80-
/// <c>true</c> if the <paramref name="first"/> object is equal to the <paramref name="second" /> object; otherwise, <c>false</c>.
81-
public static bool operator ==(Unit first, Unit second) => true;
78+
/// <param name="_">The first object.</param>
79+
/// <param name="__">The second object.</param>
80+
/// <returns><c>true</c> if the first object is equal to the second object; otherwise, <c>false</c>.</returns>
81+
public static bool operator ==(Unit _, Unit __) => true;
8282

8383
/// <summary>
84-
/// Determines whether the <paramref name="first"/> object is not equal to the <paramref name="second"/> object.
84+
/// Determines whether the first object is not equal to the second object.
8585
/// </summary>
86-
/// <param name="first">The first object.</param>
87-
/// <param name="second">The second object.</param>
88-
/// <c>true</c> if the <paramref name="first"/> object is not equal to the <paramref name="second" /> object; otherwise, <c>false</c>.
89-
public static bool operator !=(Unit first, Unit second) => false;
86+
/// <param name="_">The first object.</param>
87+
/// <param name="__">The second object.</param>
88+
/// <returns><c>true</c> if the first object is not equal to the second object; otherwise, <c>false</c>.</returns>
89+
public static bool operator !=(Unit _, Unit __) => false;
9090

9191
/// <summary>
9292
/// Returns a <see cref="System.String" /> that represents this instance.

Sources/EasyExtensions.Mediator/Mediator.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,12 @@ public Task Send<TRequest>(TRequest request, CancellationToken cancellationToken
9898
/// <remarks>The request is dispatched to a handler based on its runtime type. If multiple
9999
/// handlers are registered for the same request type, the behavior is implementation-specific. The method
100100
/// supports both requests with and without a response type.</remarks>
101-
/// <param name="request">The request object to send. Must implement either IRequest or IRequest<TResponse>.</param>
101+
/// <param name="request">The request object to send. Must implement either IRequest or IRequest with a response type.</param>
102102
/// <param name="cancellationToken">A cancellation token that can be used to cancel the request operation.</param>
103103
/// <returns>A task that represents the asynchronous operation. The task result contains the response from the handler,
104104
/// or null if the request does not produce a response.</returns>
105105
/// <exception cref="ArgumentNullException">Thrown if the request parameter is null.</exception>
106-
/// <exception cref="ArgumentException">Thrown if the request object does not implement IRequest or IRequest<TResponse>.</exception>
106+
/// <exception cref="ArgumentException">Thrown if the request object does not implement IRequest or IRequest with a response type.</exception>
107107
/// <exception cref="InvalidOperationException">Thrown if a handler wrapper cannot be created for the specified request type.</exception>
108108
public Task<object?> Send(object request, CancellationToken cancellationToken = default)
109109
{
@@ -234,12 +234,12 @@ public IAsyncEnumerable<TResponse> CreateStream<TResponse>(IStreamRequest<TRespo
234234
/// <remarks>The returned stream is evaluated asynchronously. Consumers should enumerate the
235235
/// stream using await foreach. Each call to this method resolves the appropriate handler for the request type
236236
/// using dependency injection.</remarks>
237-
/// <param name="request">The request object to process. Must implement the IStreamRequest<TResponse> interface.</param>
237+
/// <param name="request">The request object to process. Must implement the IStreamRequest interface.</param>
238238
/// <param name="cancellationToken">A cancellation token that can be used to cancel the stream operation.</param>
239239
/// <returns>An asynchronous stream of response objects corresponding to the request. The stream may be empty if there
240240
/// are no results.</returns>
241241
/// <exception cref="ArgumentNullException">Thrown if the request parameter is null.</exception>
242-
/// <exception cref="ArgumentException">Thrown if the request object does not implement the IStreamRequest<TResponse> interface.</exception>
242+
/// <exception cref="ArgumentException">Thrown if the request object does not implement the IStreamRequest interface.</exception>
243243
/// <exception cref="InvalidOperationException">Thrown if a handler wrapper for the request type cannot be created.</exception>
244244
public IAsyncEnumerable<object?> CreateStream(object request, CancellationToken cancellationToken = default)
245245
{

0 commit comments

Comments
 (0)