Closed jasonlaw closed 3 years ago
The simplest and probably the most efficient way is to retrieve list of user's communities; and then, assuming you have a list of all communities cached somewhere in c#, merge it with user's communities to get what you want, on c# side. I assume lists are hundreds, not millions
Thanks for the suggestion, I will try that out. Btw, is it possible for the view to have parameter?
NO, as far as I know. There's such thing as Table-valued functions in MS SQL, these are essentially views with params.
I am using mysql and also try not to have too much dependency to a specific dbms. Anyway, thanks for the clarification. Your suggestion works well so will closing this issue.
One out topic questions, I am very interested to understand how smart loading works and how it solve the n+1 problem, do you have plan to write some documents about it?
Vita is a great framework, really appreciate your work.
smart loading - explained here, in the last section Batching and ORM: https://github.com/rivantsov/ngraphql/wiki/QuickStart
The smart loading is only effective in ngraphql? Can it be utilized in REST?
yes, anywhere, just open session with this extra flag and you have it working. And all stuff applies
Cool!!! Thanks for the clarification! :)
I have the following entity schema.
Suppose a login user call an API, I want to return a list of Community, with a flag if the user is a member or not.
Eg of Community list output.
May I know what is the most efficient way to construct the query? I am thinking of using View but it doesn't has parameter.