Interface IGenericConverter
Generic converter interface for converting between two or more types
Namespace: Steeltoe.Common.Converter
Assembly: Steeltoe.Common.Abstractions.dll
Syntax
public interface IGenericConverter
Properties
| Edit this page View SourceConvertibleTypes
Gets the source and target types this converter can convert between.
Declaration
ISet<(Type Source, Type Target)> ConvertibleTypes { get; }
Property Value
Type | Description |
---|---|
ISet<System.ValueTuple<Type, Type>> |
Methods
| Edit this page View SourceConvert(Object, Type, Type)
Convert the source object to the target type.
Declaration
object Convert(object source, Type sourceType, Type targetType)
Parameters
Type | Name | Description |
---|---|---|
System.Object | source | the object to convert; the source can be null |
Type | sourceType | the type of the source that should be used during the conversion. Can be null, and defaults to the type of the source object |
Type | targetType | the type we are converting to |
Returns
Type | Description |
---|---|
System.Object | the converted object |