Skip to content

Commit 8572335

Browse files
committed
docs(readme): update usage documentation
1 parent 6fc6a1c commit 8572335

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,15 @@ public class Person : Identifiable<int>
113113
#### Relationships
114114

115115
In order for navigation properties to be identified in the model,
116-
they should be labeled as virtual.
116+
they should be labeled with the appropriate attribute (either `HasOne` or `HasMany`).
117117

118118
```csharp
119119
public class Person : Identifiable<int>
120120
{
121121
[Attr("first-name")]
122122
public string FirstName { get; set; }
123123

124+
[HasMany("todo-items")]
124125
public virtual List<TodoItem> TodoItems { get; set; }
125126
}
126127
```
@@ -135,6 +136,8 @@ public class TodoItem : Identifiable<int>
135136
public string Description { get; set; }
136137

137138
public int OwnerId { get; set; }
139+
140+
[HasOne("owner")]
138141
public virtual Person Owner { get; set; }
139142
}
140143
```

0 commit comments

Comments
 (0)