I write a linq query. It is showing error, i did not understand why this is error.
please see the query as below :
var timestamp = DateTime.Now.AddDays(-10);
var list = (from a in db.AppInfos
join b in db.Infos on a.App.AppId equals b.AppId
where a.Timestamp > timestamp
select new Info
{
Id = int.MaxValue,
AppId=b.AppId,
Address = a.Address,
Timestamp = a.Timestamp,
}).ToList();
It is throwing the error:
The entity or complex type 'DomainClass' cannot be constructed in a LINQ to Entities query.
I want to know why it is throwing error and what is the solution to rectify this error
please help me...