protected virtual void EnsureIsLoaded() { if (_list == null) { if (_totalCount == null) { _totalCount = SourceQuery.Count(); } if (_queryIsPagedAlready) { _list = SourceQuery.ToList(); } else { _list = ApplyPaging().ToList(); } } }
private void EnsureIsLoaded() { if (_list == null) { if (_totalCount == null) { _totalCount = SourceQuery.Count(); } if (_queryIsPagedAlready) { _list = SourceQuery.ToList(); } else { _list = ApplyPaging(SourceQuery).ToList(); } } }
private async Task EnsureIsLoadedAsync() { if (_list == null) { if (_totalCount == null) { _totalCount = SourceQuery.Count(); } if (_queryIsPagedAlready) { _list = await SourceQuery.ToListAsync(); } else { _list = await ApplyPaging(SourceQuery).ToListAsync(); } } }