public JsonNetResult getModelById(int id) { Line data = _lineService.GetLineById(id); LineViewModel model = new LineViewModel(); model.Id = data.Id; model.Name = data.Name; model.Location = data.Location; model.InCharge = data.InCharge; model.SiteId = 1; model.PlantId = data.PlantId; model.IsActive = data.IsActive; //model.SiteName = data.Plant.Site.Name; // model.Sites = _siteService.GetAll("").ToArray(); // model.PlantName = data.Plant.Name; // model.Plants = this._plantService.GetPlantsForSite(model.Sites.Select(s => s.Id).FirstOrDefault()); //_plantService.GetAll("", 0).ToArray(); model.ErrorMessage = ""; return(JsonNet(model, JsonRequestBehavior.AllowGet)); }