Hi, I'm having the following interfaces:
public interface IBase
{
int id1 { get; set; }
}
public interface IDerived : IBase
{
int id2 { get; set; }
}
And the following (sample) program:
class Program
{
static void Main(string[] args)
{
IList<IDerived> derived = null;
Check(derived);
}
static void Check(IList<IBase> base)
{
}
}
I'm getting this compliation error:
cannot convert from 'System.Collections.Generic.IList<IDerived>
' to 'System.Collections.Generic.IList<IBase>
'
If I'm trying to pass only one instance, and not a list, it's working, so what am I missing here?
Thanks,