In my models constructor I want to be able to use:
string s = Json(object);
The only way I can get Json()
to work is if I make the model class inherit Controller
.
I don't know enough to know if this is a bad thing but it strikes me as a warning that the model shouldnt be inheriting from controller. Is this bad practice to use Json()
inside model? Is this putting too much logic inside a model?
If it matters is there another way to add reference to get Json()
to work without inheriting controller?