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

Nullable types don't get set #10

Closed
ross2411 opened this issue Mar 8, 2018 · 4 comments
Closed

Nullable types don't get set #10

ross2411 opened this issue Mar 8, 2018 · 4 comments

Comments

@ross2411
Copy link
Contributor

ross2411 commented Mar 8, 2018

I've got complex objects which have nullable types (ie int?, DateTimeOffSet?). The Moq.Dapper extension for QueryAsync seems to set these all to null instead of their value. I attempted a PR to fix this because I noticed you are restricting the types to non-null types. Adding nullable types just throws an exception in Dapper though.
Any ideas?

@UnoSD
Copy link
Owner

UnoSD commented Mar 9, 2018

Now it supports nullables :) 52dbe86

It probably won't support DateTimeOffset as it's not a primitive, but it's a bit late in my time zone. Have a look at my last commit, it should be easy to add and I would welcome a PR to fix it.

@UnoSD UnoSD closed this as completed Mar 9, 2018
@UnoSD
Copy link
Owner

UnoSD commented Mar 10, 2018

Got carried away. It was an easy change, now it supports also non-primitive. 5137d07

@ross2411
Copy link
Contributor Author

Thanks for the speedy response. I've just raised a PR which adds support for the async query. Could you take a look when you get a chance. I've had issues with the unit test though

@UnoSD
Copy link
Owner

UnoSD commented Mar 12, 2018

No problem, it may be a while as I may be away next weekend, but thank you for the contribution and I'll merge it in as soon as I can.

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