I have these types in c#
public class A : IA
{
}
public interface IA
{
}
public class B
{
public B()
{
A = new List<A>(); //Where I have problem
}
public ICollection<IA> A { get; set; }
}
I've got this cast error:
Cannot implicitly convert type 'System.Collections.Generic.List' to 'System.Collections.Generic.ICollection'. An explicit conversion exists (are you missing a cast?)
How can I do such things!