Integrating using Dapper
Dapper is an open source simple object mapper for .NET-based applications. It's also referred to as Micro ORM when compared with Entity Framework or NHibernate.
It extends the IDbConnection
interface and does not depend on any specific DB implementation; this makes it work with almost all relational databases, such as SQLite, SQL CE, Firebird, Oracle, MySQL, PostgreSQL, and SQL Server.
It's considered as the king of ORM for being lightweight, high performance among other ORM. I recommend reading their GitHub repo at https://github.com/StackExchange/dapper-dot-net.
As Dapper is used with an existing database, we will use the same AdventureWorks2014 database for it. In this section, we will work with the HumanResources.Department
table.
Let's create an ASP.NET Core Web API application integrating with the AdventureWorks2014 database using Dapper ORM.
Creating AdvWrksDapper Web API and adding Dapper library
Dapper can be used with the full .NET Framework as well as .NET Core...