• Stars
    star
    109
  • Rank 319,077 (Top 7 %)
  • Language
    C#
  • License
    MIT License
  • Created about 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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

Next Things..

  • LOGO
  • Better unit tests
  • Improved sample

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.

More Repositories

1

C-Programlama-Ornekleri

C programlama dili ile yazilmis olan ornek programlar
C
65
star
2

MenuDroid

MenuDroid - Android Restaurant Managment Project
Java
28
star
3

MQuote

MQuote provides you +700 Motivational & Inspirational quotes by famous authors, celebrities. Powered by Flutter
Dart
26
star
4

Ayb.Debezium.Ticket

.NET framework based implementation of the Outbox Pattern using Apache Kafka and Debezium.
C#
21
star
5

AybCache

Caching techniques with aspect-oriented strategy by using Castle
C#
14
star
6

MenuDroid-Server

MenuDroid - Android Restaurant Managment Project - Server Side
Java
9
star
7

TcmbSharp

Currency exchange rate to Turkish Lira (TL) using the Central Bank of the Republic of Turkey (TCMB) daily xml
C#
7
star
8

slug.based.routing

Localized Slug Based Routing ASP.NET Core
C#
6
star
9

SignalR.WebApi.Demo

Demo with using SignalR, WebApi. Sql Server
C#
6
star
10

RoofPatterns

C#
5
star
11

ChatBot-CurrencyConverterToTL

Microsoft Bot Framework based Chat Bot application. You can see TL rate based USD or EUR
C#
5
star
12

solid.practices

Practice of SOLID Principles for C# Developers
C#
4
star
13

design.pattern.practices

A reference library for design patterns
C#
4
star
14

CSharp-Workspace

This repository about my C# workouts
PowerShell
3
star
15

Ayb.Linq

C#
3
star
16

Scopus.Dotnet.Client

Easy to understand C#.NET client for Scopus API
C#
2
star
17

C_Struct_Program_Ornegi

C sınav sorusu örneği struct yapıları
2
star
18

BBS

Simple Crud Application with Using Knockout.js and WCF
JavaScript
2
star
19

Android-Workspace

Android examples codes from arslanaybars.com/android
Java
1
star
20

FilmReplikleri

FilmReplikleri C# Uygulaması
C#
1
star
21

hello-github

Hello Github Project
HTML
1
star
22

blank.netcore

HTML
1
star
23

Sayi_Tahmin_Oyunu

Her öğrencinin mutlaka bir kere yazdığı veya yazacağı sayı tahmin oyunu
C++
1
star
24

FinikeWebSite

Web site that about Antalya/Finike informations in english.Prepared for my internet techonolgy lecture project at siauliai state collage.
HTML
1
star
25

PAS

Reflection based Plugin Architecture Sample with using c# (netstandard2.0)
C#
1
star
26

C-Programlama-Lab-Sorulari-Karabuk-Universitesi

Karabük Üniversitesi Bilgisayar Mühendisliği Lab Sorularının Çözümleri
C
1
star
27

MovieInformative

Movie Informative
C#
1
star