File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
src/JsonApiDotNetCore/Models Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,17 @@ public class Person : Identifiable
86
86
{ }
87
87
```
88
88
89
+ If you need to hang annotations or attributes on the ` Id ` property, you can override the virtual member:
90
+
91
+ ``` csharp
92
+ public class Person : Identifiable
93
+ {
94
+ [Key ]
95
+ [Column (" person_id" )]
96
+ public override int Id { get ; set ; }
97
+ }
98
+ ```
99
+
89
100
#### Specifying Public Attributes
90
101
91
102
If you want an attribute on your model to be publicly available,
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ public class Identifiable : Identifiable<int>
5
5
6
6
public class Identifiable < T > : IIdentifiable < T > , IIdentifiable
7
7
{
8
- public T Id { get ; set ; }
8
+ public virtual T Id { get ; set ; }
9
9
10
10
object IIdentifiable . Id
11
11
{
You can’t perform that action at this time.
0 commit comments