Closed mcmikecreations closed 1 year ago
Another issue I'm having is that it sees the parameter of type geometry as enumerable, tries to convert it using ListParameterHelper.ConvertListParameter(p, value, cmd);
at DbParameterGenerator.cs
and fails, because it thinks it's a table-valued parameter which PostgreSQL provider doesn't support.
If you want your dictionary to be case-insensitive, use a case-insensitive dictionary. For example, the Insight FastExpando
is a fast, expandable dictionary that uses case-insensitive compare:
public sealed class FastExpando : DynamicObject, IDictionary<string, object>
{
#region Private Fields
/// <summary>
/// The internal data structure.
/// </summary>
private IDictionary<string, object> data = new Dictionary<string, object>(StringComparer.OrdinalIgnoreCase);
#endregion
You can probably use FastExpando, or create your dictionary with the proper StringComparer.
Re: geometry class, I'll go look at your other issue. Geometry classes kinda suck in the ADO.NET framework but we'll see what we can do.
Gonna mark this as closed because I think case-insensitive dictionary solves your problem, but feel free to reopen.
Describe the bug
I've been trying to use this library with the PostgreSQL provider and a
Dictionary<string, object>
instead of aDynamicObject
or a type, but the dictionary check here doesn't take into account, that all parameters and fields in Postgre are lowercase and the dictionary keys may be uppercase. I'm not sure if this is exclusive to this provider, but it would be nice to have aToLower()
call inside Insight.Steps to reproduce
SingleAsync<MyType>(myName, myDictionary);
Expected behavior
The
TryGetValue
treats keys as lowercase