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
Ignore on Property mappings do not works #13
Comments
That exception is thrown by Dapper. It tries to map the |
OK, but how can i ignore complex types on Insert and Update extension methods from Dommel ? I made a pull request, please take a look. Thanks alot! |
This has nothing to do with Dommel. Dapper will try to map the complex type to a sql parameter, whether it exists in the sql query or not. Changing this on the side of Dommel won't fix your issue. I guess your best option is to create a dedicated class for update/insert with Dommel and Dapper. |
With all respect i disagree. Thanks alot |
I guess you used Dapper.FluentMap.Dommel. This utility provides a mapping from database column names back to C# POCO properties when the result from the query is received. It's also used when Dommel builds SQL queries to map the POCO properties to column names. The |
But the column names are used for build queries, isn't ? |
Correct, perhaps it should also be used for that. But that won't fix your issue, since it occurs when Dapper is trying to map it to a database type. See: https://github.com/StackExchange/dapper-dot-net/blob/master/Dapper%20NET40/SqlMapper.cs#L910 |
I understand... but when i invoke Connection.Insert()... a query will be constructed correct ? This construction must have ( Not complex types and Not Ignored properties ). Sorry for the insistence. Ps.: Did you see my pull request ? |
I think you're right, I'll have to look further into it. |
This library is awesome, i would like to continue contributing |
When i'm trying to make a Crud with this classes and ignore property Friends on Person class mapping, the "ignore" don't works with Dommel.
Error on insert method:
"System.NotSupportedException: The member Friends of type Friend cannot be used as a parameter value".
Thanks in advance
The text was updated successfully, but these errors were encountered: