Closed Ngreene-mwks closed 1 year ago
This error happens on the reference, not the entity (error message could be improved). What's your reference object like? This error means there's no property on your reference object that matches the same property on the entity.
async id => await _db.ScheduledServices.FindAsync(Guid.Parse(id.ToString()!)),
Actual entitiy Has Guid Id.
So id will contain references to both builder columns? How is that pulled? Looking in doc but not seeing anything, sorry. Thanks for the help!
It was the silly Guid parsing I was trying to do that threw things off.
async id => await _db.ScheduledServices.FindAsync(id),
Fixed things.
Thanks for pointing in the right direction
The above still failed for getting the next page however.
Changed to this:
async id => id == null ? null : await _db.ScheduledServices.FindAsync(Guid.Parse(id.ToString()!)),
And ensuring the ViewModel had Tbid on it.
Great that you got it working. I see that you're actually using MR.AspNetCore.Pagination there, so id
is just simply the entity id as an object, parsed from the HttpContext.Request.Query
, code here. And I can see that I'm only trying to parse into an int, otherwise I just keep what the IQueryCollection
gives me. And the id there shouldn't be a null, so that's weird. I might have to take another look at this.
I have an entity with a column that is defined similar to this. The entity is being generated.
I am trying to use this sorting
builder.Ascending(record => record.ServiceDate).Ascending(record => record.Tbid)
Error:
"Detail": "Property 'Tbid' not found on this object."
The Column attribute does not seem to be respected, and the query fails.I thought it was purely the attribute, but I get the same error after manually renaming the Property to TBID.
"Detail": "Property 'TBID' not found on this object."