public JsonResult CreateVariant(long Id, string Number, string JsonArr, bool IntrVar) { LabWork lab = _labRepository.GetLabWorkById(Id); if (_labRepository.CheckLabVariantExist(Id, Number)) { return(Json(ResponseConstants.LabVariantNameCollisionSystemName)); } LabVariant labVar = _labWorksContext.LabVariants.CreateNew(); labVar.LabWork = lab; labVar.Number = Number; labVar.IntroducingVariant = IntrVar; labVar.Version = 1; labVar.TaskVariants = MakeTaskVariantsList(JsonConvert.DeserializeObject <long[]>(JsonArr)); return(Json(ResponseConstants.LabVariantSaveSuccessSystemName)); }