Table of Contents

Class GenericConversionService

Namespace
Steeltoe.Common.Converter
Assembly
Steeltoe.Common.dll
public class GenericConversionService : IConversionService, IConverterRegistry
Inheritance
GenericConversionService
Implements
Derived
Inherited Members

Methods

AddConverter(IGenericConverter)

Adds a generic converter to this registry

public void AddConverter(IGenericConverter converter)

Parameters

converter IGenericConverter

the converter to add

CanBypassConvert(Type, Type)

Determine whether the conversion between source type and destination type can be bypassed.

public bool CanBypassConvert(Type sourceType, Type targetType)

Parameters

sourceType Type

the source type

targetType Type

the target type

Returns

bool

returns true if it can be bypassed

CanConvert(Type, Type)

Returns true if objects of the source type can be converted to the target type.

public bool CanConvert(Type sourceType, Type targetType)

Parameters

sourceType Type

the type of the source object

targetType Type

the type of the target object

Returns

bool

returns true if the conversion can be performed

Convert(object, Type, Type)

Convert the given source to the specified target type.

public object Convert(object source, Type sourceType, Type targetType)

Parameters

source object

the object to convert; may be null

sourceType Type

the source objects type

targetType Type

the target type to convert to

Returns

object

the converted object

Convert<T>(object)

Convert the given source to the target

public T Convert<T>(object source)

Parameters

source object

the source object to convert

Returns

T

the converted object

Type Parameters

T

the target type to convert to

GetConverter(Type, Type)

protected virtual IGenericConverter GetConverter(Type sourceType, Type targetType)

Parameters

sourceType Type
targetType Type

Returns

IGenericConverter

GetDefaultConverter(Type, Type)

protected virtual IGenericConverter GetDefaultConverter(Type sourceType, Type targetType)

Parameters

sourceType Type
targetType Type

Returns

IGenericConverter