Lezen in het Engels Bewerken

Delen via


XNamespace.Equals(Object) Method

Definition

Determines whether the specified XNamespace is equal to the current XNamespace.

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

Parameters

obj
Object

The XNamespace to compare to the current XNamespace.

Returns

A Boolean that indicates whether the specified XNamespace is equal to the current XNamespace.

Examples

The following example compares two namespaces that refer to the same URI.

C#
XNamespace aw = "http://www.adventure-works.com";
Console.WriteLine(aw == "http://www.adventure-works.com");

This example produces the following output:

True

Remarks

For two XNamespace objects to be equal, they must have the same URI.

Applies to

See also