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

ReadAsync regression #1

Closed
leecannon opened this issue Jan 8, 2021 · 1 comment
Closed

ReadAsync regression #1

leecannon opened this issue Jan 8, 2021 · 1 comment

Comments

@leecannon
Copy link

Prior versions of this library supported ReadAsync called with these generic parameters:

ReadAsync<string, TimeSpan?, TimeSpan?, string, bool>(sql)

But with newer versions this throws:

Norm.NormMultipleMappingsException: Multiple mappings requires types of same category:
    Classes with classes, records with records, value tuples with value tuple and simple types with simple types.
    For example pappings `Read<Class, int>` or `Read<int, Class>` are not permitted.
@vbilopav
Copy link
Contributor

vbilopav commented Jan 8, 2021

That exception meant to prevent mapping like this ReadAsync<string, Class>(sql) which is not supported.

However, it seems that .NET handles TimeSpan types a bit differently (there is no TypeCode unlike DateTime), so I had to fix that.

Package version 3.1.1. with this fix is being built and deployed at this moment.

I added a unit test for this issue:

public async Task ReadAsync_Regression_Issue1()

Also, support for instance mapping for TimeSpan has been added with the test also:

public async Task ReadAsync_Regression_Issue1()

@vbilopav vbilopav closed this as completed Jan 8, 2021
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