Hi
I have a question that is difficult to explain so I'll use code
snippets to help me...
I have my object:
public abstract class MyTemplate<TKey>
{
public <TKey> Key;
}
public class MyObject : MyTemplate<int>
{
public string Code;
}
and I want to make a data access class that will return a specific one
of my objects given it's key. Something like this...
public class DataAccess<TObject> where TObject: MyTemplate
{
public <TObject> GetObject( <TKey> key )
{
// TODO: do stuff here;
return null;
}
}
My question is: given type TObject, is there any way of automatically
getting TKey without having to specify it in the declaration of
DataAccess??
Cheers
Greg Bacchus