IsOptional Property
Collapse the table of content
Expand the table of content

ClaimTypeRequirement.IsOptional Property


Gets a value that indicates whether the claim is optional.

Namespace:   System.ServiceModel.Security.Tokens
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public bool IsOptional { get; }

Property Value

Type: System.Boolean

true if this instance of the class is for an optional claim; false if it specifies a required claim.

An example of how to use this property is the scenario in which the service asks for some information but does not require it. For instance, you are required to enter your first name, last name, and address, but your phone number is optional.

The following code shows how to get this property.

WSFederationHttpBinding binding = new WSFederationHttpBinding();
   (new ClaimTypeRequirement
   (new ClaimTypeRequirement
   ("", true));
ClaimTypeRequirement cr = new ClaimTypeRequirement
   ("", true);

.NET Framework
Available since 3.0
Return to top
© 2016 Microsoft