-
-
Notifications
You must be signed in to change notification settings - Fork 158
/
Copy pathPerson.cs
32 lines (26 loc) · 988 Bytes
/
Person.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System.Collections.Generic;
using JsonApiDotNetCore.Models;
using JsonApiDotNetCore.Services;
namespace JsonApiDotNetCoreExample.Models
{
public class Person : Identifiable, IHasMeta
{
[Attr("first-name")]
public string FirstName { get; set; }
[Attr("last-name")]
public string LastName { get; set; }
[HasMany("todo-items")]
public virtual List<TodoItem> TodoItems { get; set; }
[HasMany("assigned-todo-items")]
public virtual List<TodoItem> AssignedTodoItems { get; set; }
[HasMany("todo-item-collections")]
public virtual List<TodoItemCollection> TodoItemCollections { get; set; }
public Dictionary<string, object> GetMeta(IJsonApiContext context)
{
return new Dictionary<string, object> {
{ "copyright", "Copyright 2015 Example Corp." },
{ "authors", new string[] { "Jared Nance" } }
};
}
}
}