title: Advanced AngularJS paging and searching with WEB API2
body: <p>We create <em>ASP.NET MVC5</em> project with <em>AngularJS</em> and <em>WebApi 2</em>. In some views we need paging for <em>EntityList</em>. For this purpose we write <em>WebApi</em> action as follows:</p>
  
  <pre><code>  [HttpGet]
      [Route("GetAll/{pageSize:int}/{pageNumber:int}/{caseType?}/{caseDate?}/{caseNumber?}/{entryDate?}/{entryNumber?}/{seenForm?}/{levelOfAccess?}/{tagWords?}/{senderOrganization?}/{senderPerson?}")]
      [AgPermission(System.Security.Permissions.SecurityAction.Demand)]
      //[Authorize(Roles = "Katiblik")]
      public ObjectWrapperWithNameOfSet GetAll(int pageSize, int pageNumber,int? caseType = null,string caseDate = null,string caseNumber = null,string entryDate = null,string entryNumber = null,SeenForm? seenForm = null,LevelOfAccess? levelOfAccess = null,string tagWords = null,int? senderOrganization = null, int? senderPerson = null)
      {
          var caseQuery = service.List().List;
  
          if (caseType != null)
          {
              caseQuery = caseQuery.Where(@case =&gt; @case.CaseType.Id == caseType).ToList();
          }
          if (caseDate != "null")
          {
              caseQuery = caseQuery.Where(@case =&gt; @case.CaseDate == DateTime.ParseExact(caseDate, "ddMMyyyy", null)).ToList();
          }
          if (caseNumber != "null")
          {
              caseQuery = caseQuery.Where(@case =&gt; @case.CaseNumber == caseNumber).ToList();
          }
          if (entryDate != "null")
          {
              caseQuery = caseQuery.Where(@case =&gt; @case.EntryDate == DateTime.ParseExact(entryDate, "ddMMyyyy", null)).ToList();
          }
          if (entryNumber != "null")
          {
              caseQuery = caseQuery.Where(@case =&gt; @case.EntryNumber == entryNumber).ToList();
          }
          if (seenForm != null)
          {
              caseQuery = caseQuery.Where(@case =&gt; @case.SeenForm == seenForm).ToList();
          }
          if (levelOfAccess != null)
          {
              caseQuery = caseQuery.Where(@case =&gt; @case.LevelOfAccess == levelOfAccess).ToList();
          }
          if (tagWords != "null")
          {
              caseQuery = caseQuery.Where(@case =&gt; @case.TagedWords.Contains(tagWords)).ToList();
          }
          if (senderOrganization != null)
          {
              caseQuery = caseQuery.Where(@case =&gt; @case.SenderOrganization.Id == senderOrganization).ToList();
          }
          if (senderPerson != null)
          {
              caseQuery = caseQuery.Where(@case =&gt; @case.SenderPerson.Id == senderPerson).ToList();
          }
  
          var totalCount = caseQuery.Count();
          var totalPages = Math.Ceiling((double)totalCount / pageSize);
  
          var cases = caseQuery.Skip((pageNumber - 1) * pageSize)
                                  .Take(pageSize)
                                  .ToList();
  
          var result = new
          {
              TotalCount = totalCount,
              totalPages = totalPages,
              Cases = cases
          };
          return new ObjectWrapperWithNameOfSet("list", result);
      }
  </code></pre>
  
  <p>But it seemed not advanced and not clearly understanted method for Paging in WebApi2. We have many data for the case entity and we must create searching for every column of table.</p>
  
  <p>So my question is 
  <em>How to create Advanced AngularJS paging with WEB API2?</em></p>