SerializationGetOrDefaultT Method
Namespace: GemstoneAssembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.128 -- Release Build+d050cfc5563c89a1188cc3c6b2d417530856f490
JavaScript does not support generic types or methods.
- info SerializationInfo
- SerializationInfo object that contains deserialized values.
- name String
- Name of deserialized parameter to retrieve.
- defaultValue T
- Default value to return if name does not exist or cannot be deserialized.
- T
- Type of parameter to get from SerializationInfo.
TValue for specified
name; otherwise
defaultValueIn Visual Basic and C#, you can call this method as an instance method on any object of type
SerializationInfo. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
SerializationInfo do not have a direct way of determining if an item with a specified name exists, so when calling
one of the Get(n) functions you will simply get a
SerializationException if the parameter does not exist; similarly
you will receive this exception if the parameter fails to properly deserialize. This extension method protects against both of
these failures and returns a default value if the named parameter does not exist or cannot be deserialized.