Closed
Description
Example:
public class Person : Identifiable, IHasMeta
{
[Attr]
public string FirstName { get; set; }
[Attr]
public string LastName { get; set; }
public Dictionary<string, object> GetMeta()
{
return new Dictionary<string, object>
{
{"copyright", "Copyright 2018 Example Corp."},
{"authors", new[] {"John Doe"}}
};
}
}
curl https://localhost:44354/people
{"links":{"self":"https://localhost:44354///people"},"data":[{"type":"people","id":"1","attributes":{"firstName":"John","lastName":"Simmons"},"links":{"self":"https://localhost:44354///people/1"}},{"type":"people","id":"2","attributes":{"firstName":"Pete","lastName":"Bell"},"links":{"self":"https://localhost:44354///people/2"}}]}