MicroLite.TypeConverters.ObjectTypeConverter.CanConvert C# (CSharp) Method

CanConvert() public method

Determines whether this type converter can convert values for the specified type.
public CanConvert ( Type type ) : bool
type System.Type The type to check.
return bool
        public bool CanConvert(Type type)
        {
            return true;
        }

Usage Example

 public void TrueShouldBeReturned()
 {
     // Although an exlicit type converter exists for enums, ObjectTypeConverter should not discriminate against any type.
     // This is so we don't have to modify it to ignore types for which there is a specific converter.
     var typeConverter = new ObjectTypeConverter();
     Assert.True(typeConverter.CanConvert(typeof(Status)));
 }
All Usage Examples Of MicroLite.TypeConverters.ObjectTypeConverter::CanConvert