Re: EF 6 GroupBy NullReferenceException
Yeah, sorry, I missed the orderby stmt, now examples should look like these:
var finalActivities = from examActivity in activitiesFilteredForReport
orderby examActivity.CreateTime descending
group examActivity by axamActivity.CreateTime into gr
select gr.FirstOrDefault();
I can't show SQL for this query, cause it fails even I call 'ToString()'
But if I write code like this:
var finalActivities = from examActivity in activitiesFilteredForReport
orderby examActivity.CreateTime descending
group examActivity by axamActivity.CreateTime into gr
select gr.FirstOrDefault().Id;
It gives me Ids without any exception.
Subject
Written By
Posted
December 23, 2020 05:11AM
December 23, 2020 12:06PM
Re: EF 6 GroupBy NullReferenceException
December 24, 2020 06:35AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.