Click or drag to resize
DefaultConcreteTypeRepositoryRegister Method
Registers the default type of the collection.

Namespace: MsgPack.Serialization
Assembly: MsgPack (in MsgPack.dll) Version: 0.6.0
public void Register(
	Type abstractCollectionType,
	Type defaultCollectionType


Type: SystemType
Type of the abstract collection.
Type: SystemType
Default concrete type of the abstractCollectionType.
ArgumentNullExceptionabstractCollectionType is null. Or defaultCollectionType is null.
ArgumentExceptionabstractCollectionType is not collection type. Or defaultCollectionType is abstract class or interface. Or defaultCollectionType is open generic type but abstractCollectionType is closed generic type. Or defaultCollectionType is closed generic type but abstractCollectionType is open generic type. Or defaultCollectionType does not have same arity for abstractCollectionType. Or defaultCollectionType is not assignable to abstractCollectionType or the constructed type from defaultCollectionType will not be assignable to the constructed type from abstractCollectionType.
If you want to overwrite default type for collection interfaces, you can use this method. Note that this method only supports collection interface, that is subtype of the IEnumerable interface.
Note Note
If you register invalid type for defaultCollectionType, then runtime exception will be occurred. For example, you register IEnumerableT of Char and String pair, but it will cause runtime error.
See Also