CodeMan
CodeMan

Reputation: 11

Returning API result as dynamic object

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

Answers (1)

Zeeshan
Zeeshan

Reputation: 506

Use ExpandoObject and reflection to create your dynamic retun object

Refer this answer Creating object from CSV

Upvotes: 1

Related Questions