示例#1
0
        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();
                }
            }
        }
示例#3
0
        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();
                }
            }
        }