Skip to content

Commit 05985e8

Browse files
committed
README updates
1 parent 461ac9d commit 05985e8

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

README.md

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,34 @@
11
# DataAbstractions.Dapper [![NuGet](https://img.shields.io/nuget/v/DataAbstractions.Dapper.svg)](https://www.nuget.org/packages/DataAbstractions.Dapper/)
2-
A light abstraction around Dapper and Dapper.Contrib that also maintains the behavior IDbConnection.
3-
## Basic Usage
2+
A light abstraction around Dapper and Dapper.Contrib that also maintains the behavior IDbConnection. This library facilitates a loosely coupled design and unit testing.
3+
## IDataAccessor Interface
44

5-
Create a data accessor
5+
The IDataAccessor interface encapsulates Dapper extension methods. Just provide the connection to the DataAccessor.
66

77
```csharp
88

99
IDataAccessor dataAccessor = new DataAccessor(new SqlConnection(connectionString));
1010

1111
```
12-
Execute Dapper queries and sql commands normally.
12+
Execute Dapper queries and commands as you would normally.
1313

1414
```csharp
1515

1616
var person = await dataAccessor.QueryAsync<Person>(sql, new {Id});
1717

1818
```
1919

20-
Note: You need to dispose of the dataAccessor as your would with IDbConnection.
20+
Note: The dataAccessor should be disposed appropriately.
2121

22-
## Dapper.Contrib methods
22+
## Dapper.Contrib
2323

24-
IDataAccessor includes Dapper.Contrib methods
24+
IDataAccessor includes the Dapper.Contrib extension methods
2525

2626
```csharp
2727

2828
dataAccessor.Insert(new Person { Name = "John Doe" });
2929

3030
```
3131

32-
## IDbConnection methods
32+
## Keeps IDbConnection behavior
3333

34-
IDataAccessor implements IDbConnection, so you can access things like the ConnectionTimeout value.
35-
36-
```csharp
37-
38-
var timeout = dataAccessor.ConnectionTimeout;
39-
40-
```
34+
IDataAccessor implements IDbConnection, so you can access things like the ConnectionTimeout, ConnectionString, and ConnectionState etc.

0 commit comments

Comments
 (0)