The entity or complex type 'DomainClass' cannot be constructed in a LINQ to Entities query.

Posted by Kasani007 under LINQ on 12/28/2017 | Points: 10 | Views : 318 | Status : [Member] | Replies : 0
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...




Responses

(No response found.)

Login to post response