JsonApiNet
JsonApiNet copied to clipboard
how to map complex types in Attribute
how to map "name" complex type in attributes with my own class
class
`public class SubscriptionType { public string Id { get; set; }
public string BusinessModelType { get; set; }
//[JsonApiRelationship("name")] // [JsonApiAttribute("name")] //not working
public Name Name;
}`
public class Name { public string En { get; set; } public string Ur { get; set; } }
json
{ "data": [ { "attributes": { "business-model-type": "prepaid", "name": { "en": "Start prepaid", "ur": "Start Prepaid" } }, "id": "1", "links": { "self": "/api/v1/subscription-types/1" }, "relationships": { "billing-rate-plans": { "links": { "related": "/api/v1/subscription-types/1/billing-rate-plans" } } }, "type": "subscription-types" } ] }