public IActionResult Create(string org, string service, DataSourceCreateViewModel model) { if (ModelState.IsValid) { _dataSourceService.Create(org, service, model.Description, model.Url); return(RedirectToAction("Index")); } ViewBag.ErrorMessages = ModelState.Values.SelectMany(s => s.Errors).ToList(); return(View("Create", model)); }
public JsonNetResult Create(int projectId, DataSource dataSource) { Exception ex; if (!validateDataSource(dataSource, out ex)) { // TODO: return errorResult throw ex; } _dataSourceService.Create(projectId, dataSource); return(new JsonNetResult()); }