.NET Portable TypeCast  3.1.0.4
A, easy-to-use tested, generic, portable, runtime-extensible, arbitrary type converter library
Core.TypeCast.Base.ConverterCollectionDependency Class Reference

The converter dependency provides loose implementation of Converters, merely constricting the constructor to be passed an IConverterCollection for Dependency Injection. It is not required due to Constructor auto-discovery provided by TypeInfoExtension.IsDependencyInjectable yet provides strict typing at compile time and a slight speedup More...

+ Collaboration diagram for Core.TypeCast.Base.ConverterCollectionDependency:

Detailed Description

The converter dependency provides loose implementation of Converters, merely constricting the constructor to be passed an IConverterCollection for Dependency Injection. It is not required due to Constructor auto-discovery provided by TypeInfoExtension.IsDependencyInjectable yet provides strict typing at compile time and a slight speedup

ConverterCollectionDependency only serves as a constructor implementation contract

Example: Add DateTime converters loaded upon first access, through strict DependencyInjection

@code{cs}
[Converter(loadOnDemand: true, nameSpace: nameof(System), dependencyInjection: true)]
public class ConverterDateTimeDefaults : ConverterCollectionDependency
{
public ConverterDateTimeDefaults(IConverterCollection collection) : base(collection)
{
this.AddDateTimeConverter(collection: collection);
}
...
}
@endcode

Definition at line 39 of file ConverterCollectionDependency.cs.


The documentation for this class was generated from the following file: