Skip to content

Latest commit

 

History

History
105 lines (96 loc) · 2.96 KB

README.md

File metadata and controls

105 lines (96 loc) · 2.96 KB

Dynamic Search

Open in GitHub Codespaces

NuGet

Dynamic Search is a library that built from Linq.Dynamic.Core, main features including paging, sorting, and filtering. Supported multiple relational databases (Postgres, Microsoft SQL Server, MySQL,...)

How?
How to construct Search Object from front-end
How to setup in ASP.NET Core from back-end
How to run HTTP Integration Test

Features

Search with paging

{
    "pageIndex": 0,     // Page index starts from 0
    "pageSize": 100,    // Page size default is 20
}

Search with sorting

{
    "pageIndex": 0,     // Page index starts from 0
    "pageSize": 100,    // Page size default is 20
    "sorts": "id=desc,name=asc",
    "fields": ["id", "name", "type"]
}

Search with single filtering

{
    "pageIndex": 0,
    "pageSize": 100,
    "sorts": "id=desc,name=asc",
    "fields": ["id", "name", "type"],
    "filter": {
        "queryKey": "<query_key>",
        "queryType": "<query_type>",
        "operation": "<operation>",
        "queryValue": "<query_value>"
    }
}

Search with multiple filtering (and/or)

{
    "pageIndex": 0,
    "pageSize": 100,
    "sorts": "id=desc,name=asc",
    "fields": ["id", "name", "type"],
    "filter": {
        "and": [ // or
            {
                "queryKey": "<query_key>",
                "queryType": "<query_type>",
                "operation": "<operation>",
                "queryValue": "<query_value>"
            },
            {
                "queryKey": "<query_key>",
                "queryType": "<query_type>",
                "operation": "<operation>",
                "queryValue": "<query_value>"
            }
        ]
    }
}

Search with relationship one-one

{
    "pageIndex": 0,
    "pageSize": 100,
    "sorts": "id=desc,name=asc",
    "fields": ["id", "name", "type"],
    "filter": {
        "queryKey": "<reference_entity>.<query_key>",
        "queryType": "<query_type>",
        "operation": "<operation>",
        "queryValue": "<query_value>"
    }
}

Search with relationship one-many

{
    "pageIndex": 0,
    "pageSize": 100,
    "sorts": "id=desc,name=asc",
    "fields": ["id", "name", "type"],
    "filter": {
        "queryKey": "<reference_entities>.Any(e => e.<query_key>.ToString() == \"<query_value>\")",
        "queryType": "boolean",
        "operation": "eq",
        "queryValue": true
    }
}