Why am I getting “The type parameter must be invariantly valid…” error?

前端 未结 2 1027
庸人自扰
庸人自扰 2020-12-19 05:40

I\'ll attempt to shorten this code example:

public interface IThing
{
    //...  Stuff
}

public class Thing1 : IThing
{  
}

public class Thing2 : IThing
{          


        
2条回答
  •  猫巷女王i
    2020-12-19 06:30

    To expand on SLaks answer:
    To make your code compile, change the return type of ViewAll from ICollection to IEnumerable.

提交回复
热议问题