E
Ethan Strauss
I have a Class "Multidictionary" which I created which is basically a
dictionary which can have multiple values for the same key. The class centers
around
private Dictionary<K, List<V>> _InnerDictionary;
and provides methods to add to the InnerDictionary, remove from the
InnerDictionary and so forth.
I would like to have methods which allow me to retrieve or renmove single
value items based on a specific value of one pf their properties. I can't
figure out how to be able to examine the values of properties of a geneic
type. I suspect that it is possible with Reflection, but I can't find.
What I am thinking of is something like:
public void RemoveItemsWithSpecificValuePropertyValue(P
comparisonValue)
{
foreach (K key in _InnerDictionary)
{
foreach (V value in K)
{
if (value.P == comparisonValue)//This is the part that I
don't know how to do
{
// Remove value from list
}
}
}
}
Thanks for any help!
Ethan
dictionary which can have multiple values for the same key. The class centers
around
private Dictionary<K, List<V>> _InnerDictionary;
and provides methods to add to the InnerDictionary, remove from the
InnerDictionary and so forth.
I would like to have methods which allow me to retrieve or renmove single
value items based on a specific value of one pf their properties. I can't
figure out how to be able to examine the values of properties of a geneic
type. I suspect that it is possible with Reflection, but I can't find.
What I am thinking of is something like:
public void RemoveItemsWithSpecificValuePropertyValue(P
comparisonValue)
{
foreach (K key in _InnerDictionary)
{
foreach (V value in K)
{
if (value.P == comparisonValue)//This is the part that I
don't know how to do
{
// Remove value from list
}
}
}
}
Thanks for any help!
Ethan