I have two tables a parent and a child table. The child table has a column sortorder (a numeric value). Because of the missing support of the EF to persist a IList inclusive
In addition to needing to order, I needed to limit the results of the children. I did it like this:
var transactions = await _context.Transaction
.Include(x => x.User)
.OrderByDescending(x => x.CreatedAt)
.Where(x => x.User.Id == _tenantInfo.UserId)
.Take(10)
.ToListAsync();
var viewmodel = _mapper.Map(transactions.First().User);