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
8686{ }
8787```
8888
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+
89100#### Specifying Public Attributes
90101
91102If 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>
55
66 public class Identifiable < T > : IIdentifiable < T > , IIdentifiable
77 {
8- public T Id { get ; set ; }
8+ public virtual T Id { get ; set ; }
99
1010 object IIdentifiable . Id
1111 {
You can’t perform that action at this time.
0 commit comments