Method IsSerializable
- Namespace
- Xunit.Sdk
- Assembly
- xunit.v3.common.dll
IsSerializable(object?)
Determines if an object instance is serializable.
public bool IsSerializable(object? value)
Parameters
valueobjectThe object to test for serializability.
Returns
- bool
Returns
trueif the object can be serialized;false, otherwise.
Remarks
As null values always return true, even if the underlying type (which is unknown)
might not be serializable, it's better to test via IsSerializable(object?, Type?)
whenever possible.
IsSerializable(object?, Type?)
Determines if a given type supports serialization.
public bool IsSerializable(object? value, Type? type)
Parameters
valueobjectThe object to test for serializability.
typeTypeThe type to test for serializability.
Returns
- bool
Returns
trueif objects of the given type can be serialized;false, otherwise.