asp.net web api - Right approach to enriching JSON data from a Web API call before sending the ActionResult back in MVC 5 -


I'm new to ASP .NET MVC 5 (in general, MVC and Web API), I'm looking for a good one Based on the data, approach to making my own void in the MVC controller, I come back from making a web API call.

Web API Call Method Returns to Such Data

  Public Action Result GetConfigTable ([DataSourceRequest] DataSourceRequest request) {var emp = new fpECMEntities (); IQueryable & LT; Models.MyTable & gt; EmpSecurity = emp.MyTable; Data source resource result = empSecurity.ToDataSourceResult (request); Return Jason (results, JasonSuccess Behavior, Elou Gate); }  

My opinion controller method looks like this

  Configure public functioning (see [datosaurusrext] datasource request) {var configTable = Json (MySolution. API.Controllers .HomeController.GetConfigTable ()); // Fill in the code return Jason (result, Jasonforest Behavior, Elove Gate); }  

Where there is a separate project within the API solution that keeps all the models and acts as DAL.

My question is

  1. So, here I need to add additional columns in the JSON data to come back from ADC.

    1. Is it better to create a method within ADI that generates all the data needed for my view modal?
    2. If # 1 is OK, then what is the code to massage the data? Do I have to deserize JSON data into the dataset and then add columns and return it back to JSON?

    Any and all advice is highly appreciated. BTW, I am using the Candido UI grid in the client, type Datasourceresearch and DataSourceRescentCendo.U.DatesSource Library.

    Thanks


Comments