New to the site, and C#, and the site has been a great help. I have been experimenting with the 'An Elegant C# Data Access Layer using the Template Pattern and Generics' article, hopefully someone can help me with this problem.
I have 3 objects: ObjectA, ObjectB, ObjectC. All 3 are derived from an object ParentObject. Parent Object has a property 'ID'.
If the objects are stored in a Collection like: Collection
Is there any way that I can use Collection
Posted Mar 15, 2009, 12:53 PM
void MyFunction
{
// Process the list here
}
This will ensure that all objects in the list passed to MyFunction inherit from ParentClass, so they will all have the ID property.
DavePosted Mar 15, 2009, 2:50 PM