|
-
Sep 6th, 2022, 09:46 AM
#8
Re: List.Contains Doing Something Unexpected
There is a certain fuzziness in my language, which is because there is a certain fuzziness in the situation. In some classes, I deliberately created a method IsEquivalentTo rather than Equals, because they aren't equal...but they don't need to be for the way they must be used. In the specific classes that prompted me to start this thread, I can't quite decide whether or not they have to be strictly equal.
Most of these classes will be formed from querying a pair of DB tables. These tables will each have a primary key, which will be part of the class. However, I haven't yet settled on whether or not class A has to have the same PK as class B for A=B to be true. The class represents a concept. It's a certain type of filter. Two filters can filter for the same thing in the same way, in which case they can be equal, but do they have to have the same PK in the DB? That I have not yet decided.
Though, as I write this, I just realized that they don't need the PK at all, and probably shouldn't have it, since there's a different field that would make more sense as the PK, which makes the whole question a bit moot...It's an evolving design.
My usual boring signature: Nothing
 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|