Take Last 5 Records when I don't have a CreatedAt field
Hello
How can I grab the last 5 records in the table when I don't have a DateTime field for CreatedAt?
I did search on Google, and came across this, but this doesn't seem to work in LINQPad, it says it is unsupported.
Thank you.
How can I grab the last 5 records in the table when I don't have a DateTime field for CreatedAt?
I did search on Google, and came across this, but this doesn't seem to work in LINQPad, it says it is unsupported.
.Reverse().Take(5).Reverse()Any help would be greatly appreciated.
Thank you.
Comments
TableNamePlurals.Skip(TableNamePlurals.Count() - 5)
? but if you're doing it without ordering by anything, (depending on your datasource) the results are not deterministic - I suggest ordering by PK/ID first.