wijnand
wijnand
CC#
Created by wijnand on 2/21/2023 in #help
❔ SQL RAW to LINQ question
I made something like this
14 replies
CC#
Created by wijnand on 2/21/2023 in #help
❔ SQL RAW to LINQ question
var PersonalFieldBoundary = await _medicalDbContext.PersonalFieldBoundaries.Include( x=>x.FieldBoundary)
.AsNoTracking()
.Where(x => x.ParticipantId == participantId && x.Start <= insertDate)
.GroupBy(x => new { x.FieldBoundaryId })
.Select(x => x.OrderByDescending(x => x.Start)
.Take(1))
.SelectMany(x => x)
.ToListAsync();


return PersonalFieldBoundary;
var PersonalFieldBoundary = await _medicalDbContext.PersonalFieldBoundaries.Include( x=>x.FieldBoundary)
.AsNoTracking()
.Where(x => x.ParticipantId == participantId && x.Start <= insertDate)
.GroupBy(x => new { x.FieldBoundaryId })
.Select(x => x.OrderByDescending(x => x.Start)
.Take(1))
.SelectMany(x => x)
.ToListAsync();


return PersonalFieldBoundary;
14 replies
CC#
Created by wijnand on 2/21/2023 in #help
❔ SQL RAW to LINQ question
That is correct atleast that is how I read it 🙂
14 replies
CC#
Created by wijnand on 2/21/2023 in #help
❔ SQL RAW to LINQ question
So sort.and 1 is what the s does
14 replies
CC#
Created by wijnand on 2/21/2023 in #help
❔ SQL RAW to LINQ question
It's basicly newest on top
14 replies