I want retrieve the data, and set property that was added to entityobject(via partial class) on fly.
How can I do that?
this is my query:
var ret = (from item in contex.Items
select new Itemm
{
Title = item.Title,
Count = 1 // more complex: Count =item.refToAnotherEntity.Count()
});
public partial class Itemm
{
public int Count { get; set; }
}
I get error that: The entity or complex type cannot be constructed in a LINQ to Entities query