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

Use converters for ExecuteScalar calls #665

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mattbrailsford
Copy link

@mattbrailsford mattbrailsford commented May 23, 2022

With this update, rather than just trying to convert an ExecuteScalar result type using Converter.ChangeType it uses the mappers registered with the database to allow more fine grained conversions. This will be useful for things like SQLite where it stores Guids as strings, but there is no direct conversion between string and Guid in C# so this would result in an exception, where as with this fix, an explicit converter can be added (or actually in this partiaucalr example, there is code in the mapping helper to handle this exact string > Guid scenario)

This fixes #664 and #653

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

Successfully merging this pull request may close these issues.

ExecuteScalar map strings to Guid
1 participant