I try to explain my question by using simplified source code.
The class I have is e.g.:
public class House
{
public House(...)
{
address = ...;
owner = ...;
}
public string address; //Unique variable
public string owner; //Not unique variable
}
At some point, I need a dictionary which has the "House" as key and e.g. a boolean as value. E.g.
var doesTheHouseOwnerHaveDept= new Dictionary<House,bool>();
Then, I have the problem that the dictionary "doesTheHouseOwnerHaveDept" is - of course - full of duplicates since, by considering the address and owner, multiple unique "key pairs" exist if a person owns multiple houses.
Thus, is there a possibility to modify the class such that only the "owner" variable within the class "house" is used for specifying the key of the dictionary "doesTheHouseOwnerHaveDept"?
I.e., when an owner e.g. "Max" owns the house at address "A" and "B", then, first come, first serve like, only one "House"-instance will be added to the dictionary "doesTheHouseOwnerHaveDept".
I know that in the previous example, the problem could easily be solved in other more intuitional ways, but I did not have a better idea and wanted to avoid posting original source code.
Thanks a million for your support and effort! :)