QueryStringConverter.CanConvert Method (Type)


Determines whether the specified type can be converted to and from a string representation.

Namespace:   System.ServiceModel.Dispatcher
Assembly:  System.ServiceModel.Web (in System.ServiceModel.Web.dll)

public virtual bool CanConvert(
	Type type


Type: System.Type

The Type to convert.

Return Value

Type: System.Boolean

A value that specifies whether the type can be converted.

The following code shows how to determine whether the QueryStringConverter can convert to and from the specified type.

if (converter.CanConvert(typeof(Int32)))
    converter.ConvertStringToValue("123", typeof(Int32));

.NET Framework
Available since 3.5
Available since 4.0
Return to top