I'm refactoring my code and moving business logic from the controller to the model, but it seems that Json functionalities are not available in the model. It is so strange that I'm sure it's me that I'm missing something.
In the controller I can do
var myList = (from myItem in db.MyModel
where (myItem.code == "somecode")
select myItem);
JsonResult jList = Json(myList);
As I move this code into the model I have an error on line
JsonResult jList = Json(myList);
saying that "The name 'Json' does not exist in the current context.
I have the same using statements in both model and controller, (System.Web.Mvc should be the one for Json functionality) and by right clicking Json i do not have the "resolve" option.
What am I missing?