public ActionResult list(string query = null) { var data = new List <Batch>(); if (!String.IsNullOrWhiteSpace(query)) { data = _db.GetAllBatches(query); } else { data = _db.GetAllBatches(); } return(new JsonNetResult(new { aaData = data })); }