public JsonResult TryImportContent(ImportData data) { try { var results = ImportTools.AddContent(data); return new JsonResult { Data = new { results, Success = true } }; } catch (Exception ex) { return new JsonResult { Data = new { Success = false, Error = ex.Message } }; } }
public ImportResults AddContent(ImportData data) { var results = new ImportResults(); results.SchemaResults = AddSchemas(data.Schemas); results.ModuleResults = AddModules(data.Modules); return results; }
public JsonResult Content(ImportData data) { return TryImportContent(data); }