/// <summary> /// Register dapper type handler<br/> /// 注册dapper类型处理器<br/> /// </summary> public static void Register(Type type, SqlMapper.ITypeHandler handler) { // Dapper will replace exists handler, and no need to clone typeHandlers SqlMapper.AddTypeHandlerImpl(type, handler, false); }
/// <summary> /// Configure the specified type to be processed by a custom /// <see href="https://stackexchange.github.io/Dapper/">Dapper</see> handler. /// </summary> /// <param name="contextBuilder"> /// The builder being used to configure the context. /// </param> /// <param name="type">The type to handle.</param> /// <param name="handler">The handler for the type <paramref name="type"/>.</param> /// <param name="clone">Whether to clone the current type handler map.</param> /// <returns> /// The context builder so that further configuration can be chained. /// </returns> public static DapperContextBuilder AddTypeHandlerImpl(this DapperContextBuilder contextBuilder, Type type, SqlMapper.ITypeHandler handler, bool clone) { SqlMapper.AddTypeHandlerImpl(type, handler, clone); return(contextBuilder); }