static void Main() { HashSet <DMV> set = new HashSet <DMV>(); bool DidItAddTheItem = false; DMV myDMV = new DMV(); TagInfo myTag = new TagInfo(); myTag.TagNumber = "4503"; myTag.TagState = "South Carolina"; myDMV.AddTag(myTag); DidItAddTheItem = set.Add(myDMV); Console.WriteLine(DidItAddTheItem); TagInfo myTag2 = new TagInfo(); myTag2.TagNumber = "4504"; myTag2.TagState = "North Carolina"; myDMV.AddTag(myTag); DidItAddTheItem = set.Add(myDMV); Console.WriteLine(DidItAddTheItem); myDMV.ShowTags(); foreach (var item in set) { Console.WriteLine(item.); } }
static void Main() { DMV myDMV = new DMV(); TagInfo myTag = new TagInfo(); myTag.TagNumber = "4503"; myTag.TagState = "South Carolina"; myDMV.AddTag(myTag); TagInfo myTag2 = new TagInfo(); myTag2.TagNumber = "4504"; myTag2.TagState = "North Carolina"; myDMV.AddTag(myTag); myDMV.ShowTags(); }