I am parsing a file, and I would like to save it in the search structure so that I can search for two keys.
I have User Entityone that has name, emailand idtypes don't matter.
I would like to save it in Dictionary<User, id>so that I can get the user id by viewing it with the user.
I also need another way: Dictionary<Id, User>
I can create two structures and do a search. It is easy. I would like to do this with one structure.
I'm curious if I can do this with a single structure
I thought I could do:
Dictionary<User, User>then do IEqualityComparer<User>
Is there a better way to do this?
What would be the best practice for implementing IEqualityComparer?
source
share