I am trying to get data stored in cache. But it throws an exception in the line "select new FilterSsrsLog". Exception: this function can only be called from LINQ to Entities.
List<ExecutionLog3> reportServerDB = UpdateCache(); var reportLog = (from r in reportServerDB orderby r.TimeStart descending where ((model.reportName == null ? true : r.ItemPath.Contains(model.reportName)) && (model.reportFolder == null ? true : r.ItemPath.Contains(model.reportFolder)) && (r.TimeStart >= startDateTime) && (r.TimeStart <= endDateTime) ) select new FilterSsrsLog { UserName = r.UserName, ReportName = r.ItemPath, ReportFolder = r.ItemPath, Format = r.Format, Parameters = r.Parameters, TimeStart = r.TimeStart, TimeEnd = r.TimeEnd, TotalTime = EntityFunctions.DiffMilliseconds(r.TimeStart, r.TimeEnd) });
If I remove the "select new FilterSsrsLog" block and write "select r", it will work. But I only need this coloumns, so what can I do to solve this problem?
source share