ValueTask.Equals Method

Definition

Overloads

Equals(Object)

Determines whether the specified object is equal to the current ValueTask instance.

Equals(ValueTask)

Determines whether the specified ValueTask object is equal to the current ValueTask object.

Equals(Object)

Source:
ValueTask.cs
Source:
ValueTask.cs
Source:
ValueTask.cs

Determines whether the specified object is equal to the current ValueTask instance.

C#
public override bool Equals(object? obj);
C#
public override bool Equals(object obj);

Parameters

obj
Object

The object to compare with the current object.

Returns

true if the specified object is equal to the current object; otherwise, false.

Remarks

Two ValueTask instances are equal when they wrap the same Task or the same pair of the IValueTaskSource object and the token.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided), 2.1

Equals(ValueTask)

Source:
ValueTask.cs
Source:
ValueTask.cs
Source:
ValueTask.cs

Determines whether the specified ValueTask object is equal to the current ValueTask object.

C#
public bool Equals(System.Threading.Tasks.ValueTask other);

Parameters

other
ValueTask

The object to compare with the current object.

Returns

true if the specified object is equal to the current object; otherwise, false.

Implements

Remarks

Two ValueTask instances are equal when they wrap the same Task or the same pair of the IValueTaskSource object and the token.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided), 2.1