I have two List’s that contain a object of Tag like List i need to find excluded and included to do an update operation how do find the difference in them both since they contain a Tag object. Can you use Contains function with a Tag object inside the list need some help.
Im using asp.net 2.0 so please if you can help me do it in that language please.
List<Tag> tag1 = new List<Tag>()
tag1.Add(new Tag("Apples"));
tag1.Add(new Tag("Oranges"));
tag1.Add(new Tag("Pears"));
List<Tag> tag2 = new List<Tag>()
tag2.Add(new Tag("Apples"));
tag2.Add(new Tag("Bananas"));
txtExcluded.Text = list1;
txtIncluded.Text = list2
You could implement
IEquatable<T>:Now the Contains method could work like this: