8 Replies
I have a non mapped rating in my model that i want to fill with a rating from reviews table
i don't know what
DoThis
is but if it's a custom extension method then that's not possible to do that way
EF core queries are translated to an equivalent SQL query and sent to the server, so you're limited in the kind of code you can use
you could project it to a model that includes the average rating with .Select
i ended up on this
I load needed centers first then calculate their average ratins
wanted to do it in single query but i don't know how
that looks like it would be pretty inefficient to execute, you're making N +1 queries
something like
I already include the Rating in my model i just don't map it, I will remove it and do i that way, thank you
you could do a computed column on the server side too depending on your use case
idk about the performance of that
just an average rating so idk if there is a need
i will do it with select
any way to just include it in existing object instead of creating a new one in select?
you could try mutating
x
and returning it but i don't know if that would be translatable to SQL