public JsonResult CreateSnippet(Snippet snippet, List <OperatorsHelper> Operators, List <Group> SnippetGroups) { if (ModelState.IsValid) { bool res = _snippetService.AddOrUpdateSnippet(snippet, Operators, SnippetGroups); if (res) { return(Json("Успешно зачуван снипет.", JsonRequestBehavior.AllowGet)); } } return(Json("error", JsonRequestBehavior.AllowGet)); }