Closed sigmarsson closed 2 years ago
Hi, I'm not similar yet with this great db,
but try to change you signature from IEnumerable<CacheDataItem
Same error. I reckon the problem is that generic types are rendered to indicate the number of generic parameters in the hosting type name. => `1 LiteDB doesn't allow that regex. They have an IsWord() method somewhere to check this but I don't know their API.
Hi @sigmarsson, try to create a named collection, like:
var existingSet = _ctx.GetCollection<CacheDataItem<T>>("CacheDataItem");
When you don't specify a collection name, it automatically uses typeof(T).Name, which contains the invalid char ` and causes this exception. Hope this helps, please reopen this issue if it didn't solve your problem.
@kcsombrio Thank you!
I ve just made a test with one particular generic type. Can I use the same string literal for every generic type?
Hi @sigmarsson. Yes, technically you can use the same collection name for every collection you use, that's no restriction for that, but we recommend using one name per collection
Version 5.0.11
Describe the bug This is throwing an exception:
Screenshots/Stacktrace