Closed mguinness closed 1 year ago
A clumsy way of getting it to work is to add the following code after var key = CreateKey(entry)
to match the dictionary entry.
if (key.GetType().IsArray)
{
foreach (var item in _rows.Keys)
{
if (StructuralComparisons.StructuralEqualityComparer.Equals(item, key))
{
key = item;
break;
}
}
}
Hi @mguinness, thanks for a great job! I merged your changes and published a new version of the package.
I think I discovered a potential issue with the provider. When you have a table which has a composite primary key the delete method will throw a
DbUpdateConcurrencyException
exception sinceTryGetValue
will return null.https://github.com/dualbios/FileBaseContext/blob/122b87754bc1d3928331d3ac2a77d0afa5c7a747/FileBaseContext/Storage/FileBaseContextTable.cs#L109-L134
I'm not sure what the best solution would be, but it is suggested in Dictionary<string[], object[]> c# TryGetValue always return null to use a custom
IEqualityComparer
although it might be difficult when using generic types.