Link Search Menu Expand Document

TypeToDb2TypeResolver


This IResolver<Type, DB2Type> implementation converts a .NET CLR Type into its equivalent DB2Type (e.g. stringVarChar, DateTimeTimestamp, DateTimeOffsetTimeStampWithTimeZone, GuidBinary, byte[]Blob). Nullable value types are unwrapped to their underlying type before resolution, and an unrecognized type falls back to DB2Type.VarChar.

It is used internally by Db2BulkArrayBinder to infer the DB2Type of a bound parameter when a mapping does not specify one explicitly.

Usability

var resolver = new TypeToDb2TypeResolver();
var db2Type = resolver.Resolve(typeof(DateTime)); // DB2Type.Timestamp