The following code will return an Enumerable of dynamic objects.
protected override dynamic Get(int id)
{
Func<dynamic, bool> check = x => x.ID == id;
return Enumerable.Where<dynamic>(this.Get(), check);
}
How do I select the FirstOrDefault so it is a single object not an Enumerable?
Similar to this answer but just want SingleOrDefault.
Simplest way is probably
Since some people have had trouble making this work, to test just do a new .NET 4.0 Console project (if you convert from a 3.5 you need to add System.Core and Microsoft.CSharp references) and paste this into Program.cs. Compiles and runs without a problem on 3 machines I’ve tested on.