public JsonResult GetBuildings3D()
 {
     using (AdmShipDataContext db = new AdmShipDataContext())
     {
         var buildings = db.GetBuildings3d().ToList();
         return(Json(buildings));
     }
 }
Example #2
0
        public JsonResult SubdivChanged(int id)
        {
            string     json       = "";
            JsonResult jsonResult = new JsonResult();

            using (AdmShipDataContext db3 = new AdmShipDataContext())
            {
                var builds = db3.GetBuildings3d().Where(s => s.subdivId == id).ToList();

                if (builds != null)
                {
                    json = JsonConvert.SerializeObject(builds, Formatting.Indented);
                }
                jsonResult = Json(json);
                jsonResult.MaxJsonLength = int.MaxValue;
            }
            return(jsonResult);
        }