Repository navigation
Implemented equality for tsquery type - #3357
Conversation
roji
left a comment
There was a problem hiding this comment.
I think each of the NpgsqlTsQuery subtypes should also implement IEquatable for themselves (e.g. NpgsqlTsQueryLexeme should implement IEquatable<NpgsqlTsQueryLexeme>)
Also, shouldn't we also do NpgsqlTsVector?
Will think, but for now I see no value in having it. What it will give?
It's another story. Don't want to mix a lot of things in a single PR (this block better tests, plus types need more love than I gave them for now). |
IIRC, in various situations the type is checked whether it implemented IEquatable (against itself), and different behavior is chosen - I think that happens in Dictionary for example (and definitely in EF). So the fact that NpgsqlTsQueryLexeme implements IEquatable may be important e.g. in case it's used as a key. |
|
Using as a key something which just holds a string is weird. The same applies for other derived types. |
|
Why is it weird... It allows for your dictionary to be strongly-typed only on these types. Who knows how exactly users are using our types. Do you have any reason against adding these interface implementations? |
No description provided.