Several types of personal summary C # conversion method

A, as operators
only support the data may be null.

Two, (int) conversion form
is mainly based on the type of data to determine whether the converted value type can only be converted to a value type (structure except, Object, and except also dynamic,), a reference type can be converted to a reference type ( subtype can be converted to the parent type can not be converted to other unrelated classes can also be converted to dynamic);
three, convert conversion
primarily to convert based on the value of any type can be transferred, but the transfer will not throw an exception, null It can also be used to convert.

Guess you like

Origin www.cnblogs.com/qwfy-y/p/12464033.html