dictionary - LiteDB - case sensitivity when storing Dictionary()
问题描述
I am storing an object in LiteDB containing a Dictionary<> with a key of type string, i.e. Dictionary<string, ..> My problem is that on loading the object back from LiteDB, Dictionary<> objects with key values that differ only by case are lost and only one is read back into the Dictionary<>. This is despite trying everything I can see to enable Ordinal collation and case sensitivity. The code to open the DB uses a ConnectionString as follows.
static private readonly ConnectionString ConnectionString = new ConnectionString(PdbPath(true))
{
Collation = new Collation(0x0409, System.Globalization.CompareOptions.Ordinal) // "en-US" Ordinal
};
Database = new LiteDatabase(ConnectionString);
BsonMapper.Global.TrimWhitespace = false; // don't trim whitespace from the front of strings
// serialisation overrides
BsonMapper.Global.RegisterType<...
Is there an option to have LiteDB store and load a Dictionary<string,...> object with all the original keys/values, even for keys that differ only by case?
Thanks.
解决方案
推荐阅读
- php - 如何使用 PHP 调用 QuickBooks API
- powerbi - 在查询编辑器中编辑使用 DAX 创建的“新表”
- python - 组合来自 JSON 的列表元素列表
- css - 为什么css中的百分比单位不适用于字体
- python - ModuleNotFoundError:没有命名模块 - 但是该模块确实存在
- python - Python webscraping url拆分
- ssl - 使用 SSL 在 Raspberry Pi 上运行 gRPC 服务器
- python - 使用参数调用单元测试
- mysql - Passing JSON-Objekt to MYSQL columns via node
- html - 如何使用flexbox垂直居中特定的孩子?