Skip to content

Commit 783999c

Browse files
committed
docs: updated readme with the call to the newer and older mapping method
1 parent c2f5a58 commit 783999c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

README.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class MyClass
3636

3737
var dataReader = new SqlCommand("SELECT * FROM MyTable", connection).ExecuteReader();
3838

39-
List<MyClass> results = dataReader.ToMyClass(); // "ToMyClass" method is generated at compile time
39+
List<MyClass> results = dataReader.To<MyClass>();
4040
```
4141

4242
Some notes for the above
@@ -49,6 +49,14 @@ Some notes for the above
4949
* Properly maps `DBNull` to `null`.
5050
* Complex-type properties may not work.
5151

52+
### Legacy Mapping Method
53+
54+
The `To<T>()` method has been added to unify the method calls, however the previous version of this method is maintained for now.
55+
56+
```csharp
57+
List<MyClass> results = dataReader.ToMyClass();
58+
```
59+
5260
## Bonus API: `SetPropertyByName`
5361

5462
This package also adds a super fast `SetPropertyByName` extension method generated at compile time for your class.

0 commit comments

Comments
 (0)