locked
Cannot convert lambda expression to type System.Collections.Generic.ICollection<TObject> because it is not a delegate type RRS feed

  • Question

  • User-626088549 posted

    I have the following:

            public AttributeCollection(string objectUrn) : this(new Uri(objectUrn)) { }
            public AttributeCollection(Uri objectUrn) : base(() => Service.FindAllByObjectUrn(objectUrn).ToList())       
            {
                ObjectUrn = objectUrn;
            }

    The lambda is throwing the error in the subject. The strange part thing is, prior to the conversion to Visual Studio 2010 from Visual Studio 2008, the code compiles fine. It's still targeting .NET framework 3.5. I don't understand what possibly could have changed from migrating to 2010 that would affect this. Any pointers?

    Tuesday, June 24, 2014 11:34 AM

All replies

  • User465171450 posted

    Try adding the using:

    using System.Data.Entity;

    Tuesday, June 24, 2014 1:16 PM