AdvancedWebAPI
AdvancedWebAPI copied to clipboard
Minimal Web API to advanced data retrieval using pagination, filtering, searching, sorting
π Table of Contents
- π About the Project
- π Built With
- Tech Stack
- Key Features
- π Built With
- π» Getting Started
- Setup
- Prerequisites
- Install
- Usage
- π₯ Authors
- βοΈ Show your support
- π Acknowledgements
- β FAQ (OPTIONAL)
- π License
π AdvancedWebAPI
AdvancedWebAPI is a .NET Solution that uses a layer architecture to expose a minimal Web API and to validate advanced data recovery using paging, filtering, searching and sorting.
Web API Service:
getAdvancedPeople Method:
Paging:

Paging Header:

Paging in Postman:

Filtering:

Filtering in Postman:

Searching:

Searching in Postman:

Sorting:

Sorting in Postman:

DTO Schema:

getAllPeople Method:

π Built With
Tech Stack
.NET Core Minimal API,
Server
Database
Key Features
- EF Core Database First
- Unit of Work and Repository Patterns
- Services Dependency Injection
(back to top)
π» Getting Started
To get a local copy up and running, follow these steps:
Prerequisites
In order to run this project you need:
- Visual Studio .NET 2022 updated to use NET Core 7
- SQL Server Database
Setup
- Clone this repository to your desired folder:
cd my-folder
git clone https://github.com/NeckerFree/AdvancedWebAPI
-
Download and restore the Adventure Works Database according to your SQL Server version Adventure Works DB
-
Create a User as db_owner of this batabase
-
Modify the connection string (AdventureWorksConnection) in the file \AWA.MinApi\appsettings.json to point your database
Install
Install this project with:
-
Build the solution and assure that doesn't have errors
-
Set the project AWA.MinApi as default
Usage
To run the project,
-
Start the application (F5)
-
The /swagger/index.html page is displayed
(back to top)
π₯ Authors
π€ Elio CortΓ©s
- GitHub: @NeckerFree
- Twitter: @ElioCortesM
- LinkedIn: elionelsoncortes
(back to top)
π€ Contributing
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
(back to top)
βοΈ Show your support
If you like this project please start my project
(back to top)
π Acknowledgments and references
This project is based on the articles published by Code Maze: Paging Filtering Searching Sorting
(back to top)
β FAQ (OPTIONAL)
-
What command are required to Scaffold from Scratch a DB First?
- Run next commands:
dotnet add AWA.DataAccess package Microsoft.EntityFrameworkCore.Design dotnet add AWA.DataAccess package Microsoft.EntityFrameworkCore.SqlServer dotnet ef dbcontext scaffold "Data Source=.;Initial Catalog=AdventureWorks2017; User Id=XXUser;Password=XXPWD;Encrypt=False" Microsoft.EntityFrameworkCore.SqlServer --project AWA.DataAccess --output-dir "AWA.Models\Models" --context-dir "AWA.DataAccess\Data" --namespace AWA.Models --context-namespace AWA.DataAccess --context AdventureWorksContext -f --no-onconfiguring dotnet tool install --global dotnet-ef dotnet tool update --global dotnet-ef -
How to Implement Unit Of Work and Generic Repository pattern?
(back to top)
π License
This project is MIT licensed.
(back to top)