K
Keith Elder
I ran into a unique situation today whereby I have a core library that
uses generics to return users from Active Directory. Example:
List<ADUser> users = ADUser.GetByName("First", "Last");
This works great. However, what I need to do is extend the ADUser
object like so:
class DataGridUser : ADUser
{
// add some new properties
// add some new methods for databinding
}
I can't figure out how to extend it though since the GetByName() returns
a List<ADUser>. Trying this doesn't work:
List<DataGridUser> users = DataGridUser.GetByName("First", "Last");
This throws an exception that GetByName cannot convert DataGridUser to
ADUser. What am I missing or doing wrong? Anyone got any ideas?
-Keith
uses generics to return users from Active Directory. Example:
List<ADUser> users = ADUser.GetByName("First", "Last");
This works great. However, what I need to do is extend the ADUser
object like so:
class DataGridUser : ADUser
{
// add some new properties
// add some new methods for databinding
}
I can't figure out how to extend it though since the GetByName() returns
a List<ADUser>. Trying this doesn't work:
List<DataGridUser> users = DataGridUser.GetByName("First", "Last");
This throws an exception that GetByName cannot convert DataGridUser to
ADUser. What am I missing or doing wrong? Anyone got any ideas?
-Keith