I have a list of items. An element is an object with two fields. One field is of type Dictionary<string, List<string>, and the second is of type int. Now I want to check if there is an element with both fields unique in this list. In the dict field, I care about the key part, not the value, so the part of the value can be the same between the elements. This is a key that must be unique on this list.
If such an element exists, I want to be able to get the position of this element in my list.
Hope this is understandable.
To clarify -
Here is my class
namespace Polstyr
{
class RecordItem
{
Dictionary<string, List<string>> dict;
public string MachineNr { get; set; }
public RecordItem()
{
dict = new Dictionary<string, List<string>>();
}
public void AddToDict(string value, List<string> list)
{
dict.Add(value, list);
}
public Dictionary<string, List<string>> GetDictionary
{
get
{
return dict;
}
}
}
}
In another part of my code, I have a list of type List<RecordItem>called recordItems.
, RecordItem recordItems,
. dict , MachineNr .
.