S
shapper
Hello,
I have the following class:
public class RoleResolver : ValueResolver<String[], IList<Role>> {
protected override IList<Role> ResolveCore(String[] source) {
IList<Role> roles = new List<Role>();
foreach (String r in source) {
roles.Add(new Role { Id = Int32.Parse(r) });
}
return roles;
} // ResolveCore
} // RoleResolver
How can I generalize this class to return any IList<T>?
I know that all T objects will have a property of type Id.
Thank You,
Miguel
I have the following class:
public class RoleResolver : ValueResolver<String[], IList<Role>> {
protected override IList<Role> ResolveCore(String[] source) {
IList<Role> roles = new List<Role>();
foreach (String r in source) {
roles.Add(new Role { Id = Int32.Parse(r) });
}
return roles;
} // ResolveCore
} // RoleResolver
How can I generalize this class to return any IList<T>?
I know that all T objects will have a property of type Id.
Thank You,
Miguel