Am I doing something wrong if I need code like this in a Controller? Should I be doing something differently?
public ActionResult Details(int id)
{
var svc = new ServiceClient();
var model = new MyViewModel();
model.ObjectA = svc.GetObjectA(id);
model.ObjectB = svc.GetObjectB(id);
model.ObjectC = svc.GetObjectC(id);
return View(model);
}
The reason I ask, is because I've got Linq-To-Sql on the back end and a WCF Service which exposes functionality through a set of DTOs which are NOT the Linq-To-Sql generated classes and thus do not have the parent/child properties; but in the detail view, I would like to see some of the parent/child data.