Exemple #1
0
 public static Hub BindHub(HubViewModel hubViewModel)
 {
     return new Hub()
     {
         HubID = hubViewModel.HubID,
         Name = hubViewModel.HubName,
         HubOwnerID = hubViewModel.HubOwnerID
     };
 }
Exemple #2
0
 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));
 }