Pretty simple question but I’m having a rough morning it seems.
I have the following query built out so far, and I’d like to select the first object in the returned result, but not the ID itself, but the underlying User that has that ID.
Does that make sense?
//Edited the code for clarity!
After this OrderBy is run,
I have collection I want,
but I need to select the USER
no the UserAuctionLance.
var user = db.UserAuctionLances.Where(a => a.AuctionId == id).OrderByDescending(s => s.DateTimeOfLance).Select??
“Order all of the user bids by descending date, and give me the last user who bid on auction number Foo.”
Maybe that makes the question clearer. I need to return a User object.
Thank you for your time.
I believe you want:
That should return the first result, or null if none exist.
And as you explained below, you want the user object within a userAuctionLances so something more like: