190
CHAPTER 6 | Tackle Business Complexity in a Microservice with DDD and CQRS Patterns
Dapper is an open-source project (original created by Sam Saffron), and is part of the building blocks
used in
Stack Overflow
. To use Dapper, you just need to install it through the
Dapper
NuGet package
,
as shown in the following figure:
You also need to add a
using
directive so your code has access to the Dapper extension methods.
When you use Dapper in your code, you directly use the
SqlConnection
class available in the
Microsoft.Data.SqlClient
namespace. Through the QueryAsync method and
other extension methods
that extend the
SqlConnection
class, you can run queries in a straightforward and performant way.
Dostları ilə paylaş: