public FileResult Export([DataSourceRequest]DataSourceRequest request) { DemoEntities db = new DemoEntities(); byte[] bytes = WriteExcel(db.Table.ToDataSourceResult(request).Data, new string[] { "Id", "Name" }); return File(bytes, "application/vnd.ms-excel", "GridExcelExport.xls"); }
public ActionResult Read([DataSourceRequest]DataSourceRequest request) { DemoEntities db = new DemoEntities(); return Json(db.Table.ToDataSourceResult(request)); }