i am not sure it is possible or not.
i want to build a dictionary with Multi column key(let's say 4). then search by a few columns(2 or 3).
code:
class keyset
{
public keyset()
{}
public long sId;
public long aId;
public string Name;
public string title;
}
Dictionary<keyset, string> myDictionary = new Dictionary<keyset, string>();
Then i want to search by only a few column in the keyset:
case 1: sid = 100 and aid=200
case 2: sid = 50 and name="John"
.......
how can i do this?
Ok i understand that is not possible. I should use linq.
Then i want to know which structure will be faster:
plan A: use dictionary
class keyset
{
public keyset()
{}
public long sId;
public long aId;
public string Name;
public string title;
}
Dictionary<keyset, string> myDictionary = new Dictionary<keyset, string>();
plan B: without dictionary
class data
{
public data()
{}
public long sId;
public long aId;
public string Name;
public string title;
public string Value; <--------
}