Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 1b411b5

Browse files
committed
Add docs on Querying POCO's with References
1 parent 48925f0 commit 1b411b5

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[Join the ServiceStack Google+ group](https://plus.google.com/u/0/communities/112445368900682590445) or
22
follow [@servicestack](http://twitter.com/servicestack) for updates.
33

4-
# A Fast Micro ORM for .NET
4+
# A Fast, Simple, Typed ORM for .NET
55

66
# Introduction
77

@@ -599,6 +599,20 @@ db.Save(customer, references:true);
599599

600600
This saves the root customer POCO in the `Customer` table, its related PrimaryAddress in the `CustomerAddress` table and its 2 Orders in the `Order` table.
601601

602+
### Querying POCO's with References
603+
604+
The `Load*` API's are used to automatically load a POCO and all it's child references, e.g:
605+
606+
```csharp
607+
var customer = db.LoadSingleById<Customer>(customerId);
608+
```
609+
610+
Using Typed SqlExpressions:
611+
612+
```csharp
613+
var customers = db.LoadSelect<Customer>(q => q.Name == "Customer 1");
614+
```
615+
602616
More examples available in [LoadReferencesTests.cs](https://github.com/ServiceStack/ServiceStack.OrmLite/blob/master/tests/ServiceStack.OrmLite.Tests/LoadReferencesTests.cs)
603617

604618
Unlike normal complex properties, references:

0 commit comments

Comments
 (0)