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



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 asp.net mvc 5(mvc , web api in general), i'm looking approach creating viewmodel in mvc controller based on info making web api call.

the web api phone call method returns info this

public actionresult getconfigtable([datasourcerequest] datasourcerequest request) { var emp = new fpecmentities(); iqueryable<models.mytable> empsecurity = emp.mytable; datasourceresult result = empsecurity.todatasourceresult(request); homecoming json(result, jsonrequestbehavior.allowget); }

my views controller method looks

public actionresult config_read([datasourcerequest] datasourcerequest request) { var configtable = json(mysolution.api.controllers.homecontroller.getconfigtable()); // fill in code homecoming json(result, jsonrequestbehavior.allowget); }

where api separate project within solution keeps models , acts dal. so, here need add together additional columns json info api before send off grid in view.

my questions is

is right approach create viewmodel in mvc controller massaging info here is improve create method within api generates info required viewmodel? if #1 ok, code massage data? have deserialize json info dataset , add together columns , homecoming json again?

any , advice appreciated. btw, i'm using kendo ui grid @ client, types datasourcerequest , datasourceresult kendo.ui.datasourcerequest library.

thanks

asp.net-web-api asp.net-mvc-5 viewmodel kendo-asp.net-mvc

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -