❔ SQL RAW to LINQ question
Greetings, I have a SQL query that was given to me but I was wondering if this query could be simplefied into a LINQ query.
A lot of the program was made during the time of EF core 1.0. we have a ton of SQL RAW.
5 Replies
Sounds like two selects possibly?
The
???
would be row_number() OVER(PARTITION BY [FieldBoundaryId] ORDER BY [Start] DESC
ORDER BY [Start] DESC
is just .OrderByDescending(t => t.Start)
The row number and partition stuff, tho...
Distinct()
...? .GroupBy()
...? .DistinctBy()
...?It's basicly newest on top
So sort.and 1 is what the s does
so basically grouping by the
FieldBoundaryId
and taking the first item in each group ordered by Start desc for the participant,That is correct atleast that is how I read it 🙂
I made something like this
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.