lundi 27 juin 2016

Internal class masked by object

I have below in C# 4.0

Assume that a class (B)'s public function has the return line

return (object)(new List<A>{Some elements})

where A is an internal and sealed class. I cannot change the code of A or B.

After I call this function in B, how do I find the first element of that list. C# does not let me cast that list back into List<A> because A is internal.

If this doesn't make sense, I can provide more detail. Thanks!





Aucun commentaire:

Enregistrer un commentaire