Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeHandler<> can't override default typeMap for base types #206

Closed
maurodx opened this issue Nov 20, 2014 · 3 comments
Closed

TypeHandler<> can't override default typeMap for base types #206

maurodx opened this issue Nov 20, 2014 · 3 comments

Comments

@maurodx
Copy link

maurodx commented Nov 20, 2014

Trying to solve an issue (losing milliseconds on DateTime in SQLite database) using a TypeHandler that do conversion between db string (in format "o") and DateTime doesn't pass test because typeMap[DateTime] is processed before custom type handlers.

Probably the solution is to invert the lookup sequence or add the chance for remove a default type map with a brother of

public static void AddTypeMap(Type type, DbType dbType)

as

public static void RemoveTypeMap(Type type)

@maurodx
Copy link
Author

maurodx commented Nov 26, 2014

By now I have to use Reflection in order to remove from private typeMap the defaults for DateTime and DateTimeOffset.. Not a great solution but only a workaround

@maurodx
Copy link
Author

maurodx commented Nov 26, 2014

Probably can be solved via pull request #177

@NickCraver
Copy link
Member

See #471 up for v2, closing out to consolidate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants