Example #1
0
 public IHttpActionResult SearchPeople(PagedSearchDto dto)
 {
     using (ApiSampleRepository rep = new ApiSampleRepository())
     {
         var results = rep.SearchPeople(dto);
         return(Ok(results));
     }
 }
Example #2
0
 public void TestGetPeopleWithDefaults()
 {
     using (ApiSampleRepository repository = new ApiSampleRepository())
     {
         PagedSearchDto dto = new PagedSearchDto();
         dto.PageSize       = 25;
         dto.PageNumber     = 2;
         dto.OrderByColumn  = "PersonId";
         dto.OrderAscending = true;
         dto.TotalRows      = 0;
         PagedSearchResponseDto <List <PersonSearchResultDto> > response = repository.SearchPeople(dto);
         Assert.IsTrue(response.Result.Count == 25);
         Assert.IsTrue(response.Result.First().PersonId == 26);
     }
 }