I need a bit of advice. I am new to .NET MVC and I was wondering, where I'm supposed to store linq queries? In the instance below I have put them in my controller like so
public ActionResult Index()
{
var vehicles = from v in db.Vehicles
from m in db.Makes
from mods in db.Models
where v.Model.ModelID == mods.ModelID
where mods.Make.MakeID == m.MakeID
select v;
return View(vehicles.ToList());
}
Am I going about this the right way bearing in mind queries could get a lot more complex?