This project is a sample ASP.NET Core Web API for a Todo application that uses Dapper as the ORM (Object-Relational Mapper). The Todo API provides a simple yet effective way to manage tasks, illustrating the integration of Dapper for efficient database operations in an ASP.NET Core environment.
The primary purpose of this project is to demonstrate the implementation of a RESTful API for managing Todo items using ASP.NET Core and Dapper. It serves as a practical example for developers looking to understand how to build lightweight, high-performance APIs with a focus on simplicity and efficiency.
- Simplify Task Management: Provide a straightforward and efficient way to handle task creation, retrieval, updating, and deletion.
- Demonstrate Dapper Integration: Showcase how to integrate Dapper with ASP.NET Core to perform database operations efficiently.
- Educate and Guide Developers: Serve as an educational resource for developers learning to build APIs using modern technologies.
- .NET 8
- Clone project
- Install dotnet 8 or docker
dotnet restore src
dotnet build src
dotnet run --project src/ApiWithDapper.csproj
docker compose up
Finally you can remove the image with the below command:
docker rmi -f api-with-dapper
After the project is executed, you can use swagger or Todo.http file.
src
├── API
│ ├── ApiWithDapper.csproj
│ ├── appsettings.Development.json
│ ├── appsettings.json
│ ├── Helpers
│ │ ├── DatabaseInitilizer.cs
│ │ ├── PageData.cs
│ │ └── PaginationHelpers.cs
│ ├── http
│ │ └── Todo.http
│ ├── Migrations
│ │ └── Init_20240628005459.cs
│ ├── Program.cs
│ ├── Properties
│ │ └── launchSettings.json
│ └── Todo
│ ├── ITodoRepository.cs
│ ├── TodoController.cs
│ ├── Todo.cs
│ └── TodoRepository.cs
├── src.sln
└── TestProject
├── GlobalUsings.cs
├── PaginationHelpersTests.cs
├── TestProject.csproj
├── TodoControllerTests.cs
└── TodoRepositoryTests.cs
First off, thanks for taking the time to contribute! Contributions are what make the free/open-source community such an amazing place to learn, inspire, and create. Any contributions you make will benefit everybody else and are greatly appreciated.
Please read our contribution guidelines, and thank you for being involved!
The original setup of this repository is by HamidMolareza.
For a full list of all authors and contributors, see the contributors page.
This project follows good practices of security, but 100% security cannot be assured. This project is provided "as is" without any warranty.
For more information and to report security issues, please refer to our security documentation.
This project is licensed under the GPLv3.
See LICENSE for more information.