GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - arslanaybars/Fop: Filtering, Ordering (Sorting) and Pagination library for .Net Core, ASP.NET Core, C#

BranchesTags
Open more actions menu

Latest commit

 

History

67 Commits
67 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
build
build
 
 
sample
sample
 
 
src
src
 
 
test/Fop.Tests
test/Fop.Tests
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
fop.sln
fop.sln
 
 

Repository files navigation

Fop

Filtering, Ordering (Sorting) and Pagination library for .Net Core, ASP.NET Core, C#

For .Net Core developers, Fop serves you quite simple, easy to integrate and extensible Filtering, Ordering (Sorting) and Paging functionality.

Fop Nuget

To see detailed documentation please visit wiki page

Quick Start

Let's see how easy to use Fop

  1. Install Fop NuGet package from here.
PM> Install-Package Fop
  1. Add FopQuery to your get method
[HttpGet]
public async Task<IActionResult> Index([FromQuery] FopQuery request)
{
    var fopRequest = FopExpressionBuilder<Student>.Build(request.Filter, request.Order, request.PageNumber, request.PageSize);

    var (filteredStudents, totalCount) = await _studentRepository.RetrieveStudents(fopRequest);

    return Ok(filteredStudents);
}
  1. ApplyFop from your repository
 public async Task<(List<Student>, int)> RetrieveStudents(IFopRequest request)
 {
     var (filteredStudents, totalCount) = _context.Students.ApplyFop(request);
     return (await filteredStudents.ToListAsync(), totalCount);
 }

Install Fop, Build your object by using FopExpressionBuilder.Build() then ApplyFop() That's All 🤘

More and more detail at here and in Wiki page. Please visit before you decided to not use

Deep Dive

Fop Operators

Supported operators for type are below;

Fop uses these query sign for preparing expression.

Operators Query Sign Int/Long/Decimal/Double String Char DateTime Guid
Equal == ✔️ ✔️ ✔️ ✔️ ✔️
NotEqual != ✔️ ✔️ ✔️ ✔️ ✔️
GreaterThan > ✔️ ❌ ❌ ✔️ ❌
GreaterOrEqualThan >= ✔️ ❌ ❌ ✔️ ❌
LessThan < ✔️ ❌ ❌ ✔️ ❌
LessOrEqualThan <= ✔️ ❌ ❌ ✔️ ❌
Contains ~= ✔️ ✔️ ❌ ❌ ❌
NotContains !~= ✔️ ✔️ ❌ ❌ ❌
StartsWith _= ✔️ ✔️ ❌ ❌ ❌
NotStartsWith !_= ✔️ ✔️ ❌ ❌ ❌
EndsWith |= ✔️ ✔️ ❌ ❌ ❌
NotEndsWith !|= ✔️ ✔️ ❌ ❌ ❌
Example

api/students/

?Filter=Midterm>10;and

&Order=Midterm;desc

&PageNumber=1

&PageSize=2`

The above expression returns us students whose midterms is more than 10, then order by Midterm descending with page number is 1 and page size is 2.

It works! 🚀 For more about query language click here!

Examples

It works! Perfect!

Works for multiple filter logic as well! 🎉

I don't want to make readme page so crowdy. please visit the wiki page to see more feature of the package

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Contributing

Everyone is welcome to contribute!

Acknowledgments

  • DynamicExpresso It helps me to save my hair pulled down! 🙏 Thanks for the great library. It helps me a lot on Filtering.

About

Filtering, Ordering (Sorting) and Pagination library for .Net Core, ASP.NET Core, C#

Topics

asp-net-corefilterfilteringnetcoreorderpagepagingsortsorting

Resources

Readme
MIT license
Activity

Stars

112 stars

Watchers

6 watching

Forks

14 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.