This project demonstrates CRUD (Create, Read, Update, Delete) operations using Dapper in a .NET Core environment. Dapper is a lightweight and high-performance Object-Relational Mapper (ORM) that simplifies database interactions.
This project showcases the implementation of CRUD operations using Dapper, a micro ORM, in a .NET Core application. The goal is to provide efficient and straightforward database interactions while maintaining the power of raw SQL.
- Create: Add new records to the database.
- Read: Retrieve data from the database using various query methods.
- Update: Modify existing records in the database.
- Delete: Remove records from the database.
- C#: The primary programming language for the project.
- Dapper: A simple object mapper for .NET and SQL databases.
- SQL Server: The database engine used for storing and retrieving data.
To run this project locally:
- Clone the repository:
gti clone https://github.com/AbdullrhmanElhelw/DapperCrudOperations
- Open the solution in your preferred IDE.
- Configure the database connection in the app settings.
- Run the application.
Explore the different CRUD operations implemented in the code. Understand how Dapper simplifies database interactions without sacrificing performance. Modify and extend the project to suit your specific needs.
- Get All Products:
GET /Product
- Get Product by ID:
GET /Product/{id}
- Create Product:
POST /Product
- Update Product:
PUT /Product/{id}
- Delete Product:
DELETE /Product/{id}
- Find Products by Name:
GET /Product/FindByName/{name}
- Get All Products Ordered by Price:
GET /Product/GetAllOrderByPrice
- Create Multiple Products:
POST /Product/CreateMultiProduct
Refer to the code or Swagger documentation for detailed information on each endpoint.
Contributions are welcome! If you find any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request.