I am trying to build a generic method and four classes that implement IDetail. Each class has a collection of a classes that implement ITaxes. I want to build a generic method that will allow me to access the collection of each class.
Something like this:
public void UpdateCollection<T,I>(T Detail,Taxes TaxesList ) where T:IDetail where I:Itaxes
{
foreach( Taxes tax in TaxesList)
{
Detail.I.Add(tax);
}
}
I want to access the property of type I in type T. How can I do that? It is possible?
Do I need to write one method for each class?
IDetailimplement anIproperty?