public async Task <ActionResult <BooksResponseModel> > Get([FromQuery] bool flag, PaginationParams model) { var books = await Task.FromResult(_context.Books.Where(x => !x.Excluded).ToList()); if (flag) { books = books.Where(x => x.Rented).ToList(); } else { books = books.Where(x => !x.Rented).ToList(); } var response = ShowMensageResponse.BuildResponse(books, model); if (!response.Success) { var notFound = new NotFoundResult(); return(notFound); } return(Ok(response)); }