-
Notifications
You must be signed in to change notification settings - Fork 127
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
Question: IPropertyHandler for dictionary<string,string> #647
Comments
I can assume this is really not handled by the library - an edge-case TBH. A normal custom type and primitive types are only supported, as we speak. Are you blocked by this? Otherwise, you can make a small work around if such Dictionay object is wrapped within a custom class. |
Thanks for the quick reply. We are trying to convert away from dapper due to its missing enum as string handling. And now we run into this. So we need a solution or we are not converting :) |
We need to win you as a user. When do you need the fix? I will be busy this weekend due to a Talk and Demo, but hopefully you can wait on the fix til next week? |
I'm not sure I think |
@kbilsted - I had tested this scenario and it is working on the latest release of RepoDb.SqlServer v1.1.1. I followed your implementation with my own model and table schema. Here is the sample project (DictionaryPropertyHandler.zip) for your reference. If the issue still persists on your side, would you be able to provide more context for us to replicate the issue? To simplify, you can modify the attached project and trigger the problem. Then, attached it back here. Thanks! |
Thanks for the quick reply. At home I cannot reproduce the problem. I'll investigate further tomorrow. I did manage to break the code though. It happens when I do more nested dictionaries.
and sql |
I tested this one and the issue is not happening even with the Note: Please be reminded that you have to map the Property Handler as a targeted one. Do not map it on a Type-Level for this kind of purpose. |
I think my example was too hasty and in fact it works with nesting as well
and
let me try to recreate the problem I originally logged.. |
Yeah. It is good if you can replicate it and just extend the attached small project to simplify my debugging. |
@kbilsted - we are about to release the next minor version if we will receive no reports for the next 5 days. We are happy to include this one on that release or issue the next beta version with the fix for this issue and revalidate for the next 2 weeks. Would you be able to help us replicate this? Otherwise, this will not be included. |
Sorry for taking this long. I can reproduce in your example code when I insert the data using SQL change the code from the zip file
and
|
Oh, it seems to me again is because of the non-schema-based operations shinanigans. I will do check this and will get back to you right away. Thanks for replicating it. |
I just confirmed this now, I can replicate and will issue a fix for this. When do you need the fix for this? |
In .Net Core 3 when serializing a dictionary to a column I get the error
Using the following
and trying to register it both as
RepoDb.PropertyHandlerMapper.Add<Dictionary<string, string>, JsonObjectTypeHandler>();
and on my model object
The text was updated successfully, but these errors were encountered: