title: Retrieving a list of objects in ABP, C#
body: <p>I'm working with the ABP tutorials on <a href="https://docs.abp.io/en/abp/latest/Tutorials/Part-3?UI=BlazorServer&amp;DB=Mongo" rel="nofollow noreferrer">https://docs.abp.io/en/abp/latest/Tutorials/Part-3?UI=BlazorServer&amp;DB=Mongo</a> with the Acme.BookStore project. I have a list of Books and I want to use a custom filter to filter specifically by the name of the book. I know this is a simple process because I've seen examples (without code) showing how this works visually.</p>
  <p>So far I've tried adapting the instructions from this part of the documentation: <a href="https://blazorise.com/docs/extensions/datagrid/features" rel="nofollow noreferrer">enter link description here</a> (at 'Custom Column Filtering'). However, this code relies on manually creating a list of the objects you want to filter using the code below under '@code':</p>
  <pre><code>private List&lt;Employee&gt; employeeList = new() { new() { FirstName = &quot;David&quot;, Gender = &quot;M&quot; }, new() { FirstName = &quot;Mladen&quot;, Gender = &quot;M&quot; }, new() { FirstName = &quot;John&quot;, Gender = &quot;M&quot; }, new() { FirstName = &quot;Ana&quot;, Gender = &quot;F&quot; }, new() { FirstName = &quot;Jessica&quot;, Gender = &quot;F&quot; } };
  </code></pre>
  <p>With this method I'm not filtering the list of books I already have, I'm filtering through a static list that I must construct. Is there a simple way to collect all the objects of type 'Book'? (those that are presented on my .razor page)</p>
  <p>This is my code for the Razor page:</p>
  <pre><code>@page &quot;/books&quot;
  @using Volo.Abp.Application.Dtos
  @using Acme.BookStore.Books
  @using Acme.BookStore.Localization
  @using Microsoft.Extensions.Localization
  @using Volo.Abp.Localization
  @using Volo.Abp.AspNetCore.Components.Web
  @inject IStringLocalizer&lt;BookStoreResource&gt; L
  @inject AbpBlazorMessageLocalizerHelper&lt;BookStoreResource&gt; LH
  
  @inherits AbpCrudPageBase&lt;IBookAppService, BookDto, Guid, PagedAndSortedResultRequestDto, CreateUpdateBookDto&gt;
  
  &lt;Card&gt;
      &lt;CardHeader&gt;
          &lt;Row Class=&quot;justify-content-between&quot;&gt;
              &lt;Column ColumnSize=&quot;ColumnSize.IsAuto&quot;&gt;
                   &lt;h2&gt;@L[&quot;Books&quot;]&lt;/h2&gt;
              &lt;/Column&gt;
              &lt;Column ColumnSize=&quot;ColumnSize.IsAuto&quot;&gt;
                  &lt;Button Color=&quot;Color.Primary&quot;
                      Clicked=&quot;OpenCreateModalAsync&quot;&gt;@L[&quot;NewBook&quot;]&lt;/Button&gt;
              &lt;/Column&gt;
          &lt;/Row&gt;
      &lt;/CardHeader&gt;
  
  &lt;CardBody&gt;
      &lt;DataGrid TItem=&quot;BookDto&quot;
                Data=&quot;Entities&quot;
                ReadData=&quot;OnDataGridReadAsync&quot;
                TotalItems=&quot;TotalCount&quot;
                ShowPager=&quot;true&quot;
                PageSize=&quot;PageSize&quot;&gt;
          &lt;DataGridColumns&gt;
              &lt;DataGridEntityActionsColumn TItem=&quot;BookDto&quot; @ref=&quot;@EntityActionsColumn&quot;&gt;
                  &lt;DisplayTemplate&gt;
                      &lt;EntityActions TItem=&quot;BookDto&quot; EntityActionsColumn=&quot;@EntityActionsColumn&quot;&gt;
                          &lt;EntityAction TItem=&quot;BookDto&quot;
                                        Text=&quot;@L[&quot;Edit&quot;]&quot;
                                        Clicked=&quot;() =&gt; OpenEditModalAsync(context)&quot; /&gt;
                          &lt;EntityAction TItem=&quot;BookDto&quot;
                            Text=&quot;@L[&quot;Delete&quot;]&quot;
                            Clicked=&quot;() =&gt; DeleteEntityAsync(context)&quot;
                            ConfirmationMessage=&quot;() =&gt; GetDeleteConfirmationMessage(context)&quot; /&gt;
                      &lt;/EntityActions&gt;
                  &lt;/DisplayTemplate&gt;
              &lt;/DataGridEntityActionsColumn&gt;
              &lt;DataGridColumn TItem=&quot;BookDto&quot;
                              Field=&quot;@nameof(BookDto.Name)&quot;
                              Caption=&quot;@L[&quot;Name&quot;]&quot;&gt;&lt;/DataGridColumn&gt;
              &lt;DataGridColumn TItem=&quot;BookDto&quot;
                              Field=&quot;@nameof(BookDto.Type)&quot;
                              Caption=&quot;@L[&quot;Type&quot;]&quot;&gt;
                  &lt;DisplayTemplate&gt;
                      @L[$&quot;Enum:BookType:{(int)context.Type}&quot;]
                  &lt;/DisplayTemplate&gt;
              &lt;/DataGridColumn&gt;
              &lt;DataGridColumn TItem=&quot;BookDto&quot;
                              Field=&quot;@nameof(BookDto.PublishDate)&quot;
                              Caption=&quot;@L[&quot;PublishDate&quot;]&quot;&gt;
                  &lt;DisplayTemplate&gt;
                      @context.PublishDate.ToShortDateString()
                  &lt;/DisplayTemplate&gt;
              &lt;/DataGridColumn&gt;
              &lt;DataGridColumn TItem=&quot;BookDto&quot;
                              Field=&quot;@nameof(BookDto.Price)&quot;
                              Caption=&quot;@L[&quot;Price&quot;]&quot;&gt;
              &lt;/DataGridColumn&gt;
              &lt;DataGridColumn TItem=&quot;BookDto&quot;
                              Field=&quot;@nameof(BookDto.CreationTime)&quot;
                              Caption=&quot;@L[&quot;CreationTime&quot;]&quot;&gt;
                  &lt;DisplayTemplate&gt;
                      @context.CreationTime.ToLongDateString()
                  &lt;/DisplayTemplate&gt;
              &lt;/DataGridColumn&gt;
          &lt;/DataGridColumns&gt;
      &lt;/DataGrid&gt;
  &lt;/CardBody&gt;
  </code></pre>
  
  <p>The page already retrieves this list as is but uses in-built functions for the DataGrid properties etc. - is there a way to easily tap into this to use when filtering?</p>