javascript - How to pass LIST to view as JSON in MVC asp.net -


i need pass list view: enter image description here

but in format:

{   "data": [     {       "first_name": "robert",       "last_name": "meczybula",       "id": 12421        ...      }, ... ]} 

basically want transform list desired data contract. linq this:

var transform = new     {         data = data.select(x =>              new {                 x.first_name,                 x.last_name,                 ...             }),         ...     }; 

then serialize , return transform object.


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -