You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Even though whole PrimeNG.TableFilter API is async in nature there is one synchronous call in extension method PrimengTableFilter. I am talking about dataSet.Count(); by the end of the function.
Getting out int variable from method is very convenient, but this is Sync over Async antipattern. If you go async you have to go all way through.
My recommended sulution would be (unfortunately it would break the API) instead of returning int it would return query (IQueryable) without paging applied, so caller could invoke CountAsync.
Or even better, split this method into two. First method returning right after tableFilterManager.GetResult() and another that applies paging.
First of all thank you for this great library 👍
Now, for the issue:
Even though whole PrimeNG.TableFilter API is async in nature there is one synchronous call in extension method PrimengTableFilter. I am talking about dataSet.Count(); by the end of the function.
Getting out int variable from method is very convenient, but this is Sync over Async antipattern. If you go async you have to go all way through.
My recommended sulution would be (unfortunately it would break the API) instead of returning int it would return query (IQueryable) without paging applied, so caller could invoke CountAsync.
Or even better, split this method into two. First method returning right after tableFilterManager.GetResult() and another that applies paging.
example calling code would look like this:
or it still may be converted to out variable (method should output IQueryable instead of int:
The text was updated successfully, but these errors were encountered: