Because IList<T> not covariant, which means that there is nothing from stopping ChangeList from adding Group to the Users list, which is clearly invalid.
To pass a list of both types, convert the list to List<ILeader> :
ChangeList(userList.Cast<ILeader>().ToList());
However, keep in mind that this does not actually list, it creates a new list where each member is an instance of ILeader . This means that ChangeList can add Group to the list, which means you cannot convert it back to List<User> .
If ChangeList does not add any members to the list, you can simply return it back:
var leaderList = userList.Cast<ILeader>().ToList(); ChangeList(leaderList); userList = leaderList.Cast<User>().ToList();
If ChangeList adds any elements other than User , then the conversion will fail. Your best bet is to extract only User from the result:
var leaderList = userList.Cast<ILeader>().ToList(); ChangeList(leaderList); userList = leaderList.OfType<User>().ToList();
source share