Reputation: 11
I want to return dynamic object from API and that object only have properties which will be passed in url as comma seperated
e.g API Call URL:
api/Employee?Name,Age
should return Json as
{
"Name":"Emp1",
"Age":20
}
Upvotes: 0
Views: 814
Reputation: 506
Use ExpandoObject and reflection to create your dynamic retun object
Refer this answer Creating object from CSV
Upvotes: 1