public JsonResult Hub_Read([DataSourceRequest] DataSourceRequest request) { var hubs = _hubService.GetAllHub(); var hubsViewModel = HubViewModelBinder.BindListHubViewModel(hubs); return(Json(hubsViewModel.ToDataSourceResult(request), JsonRequestBehavior.AllowGet)); }
public ActionResult Hub_Create([DataSourceRequest] DataSourceRequest request, HubViewModel hubViewModel) { var hub = new Hub(); if (hubViewModel != null && ModelState.IsValid) { hub = HubViewModelBinder.BindHub(hubViewModel); _hubService.AddHub(hub); } return(Json(new[] { hub }.ToDataSourceResult(request, ModelState))); }