public JsonResult GetHomework() { HomeworkController obj = new HomeworkController(); List <tbl_homework> objHomework = obj.GetHomeworks(); var jsonResult = Json(objHomework, JsonRequestBehavior.AllowGet); jsonResult.MaxJsonLength = int.MaxValue; return(jsonResult); }
public FileResult DownloadHomework(int id) { HomeworkController obj = new HomeworkController(); List <tbl_homework> ObjFiles = obj.GetHomeworks(); var FileById = (from FC in ObjFiles where FC.id.Equals(id) select new { FC.name, FC.contenttype, FC.data }).FirstOrDefault(); return(File(FileById.data, FileById.contenttype, FileById.name)); }