LINQ in Action roller

LINQ to Objects Cast<> problem

Hi, i've written the following class: public class A { public static implicit operator A(B instance) { return new A(instance); } // ... } However, when i create a List and call Cast ().ToList() i get a runtime error saying "Unable to cast object of type 'B' to type 'A'". However, when i do a simple implicit, or explicit, cast from B to A it works fine. Thoughts ? Read More...
Published Sunday, January 27, 2008 3:17 AM by MSDN Forums: LINQ Project General
Anonymous comments are disabled

Featured Item

This Blog

Sponsoring

Syndication