public JsonResult UpdateOrInsert(string[] words) { var cookie = CookiesControll.UserAuthenticationInfo(); string word = ""; bool ok; foreach (string wr in words) { word += $"{wr};"; } word = !string.IsNullOrEmpty(word) ? word.Remove(word.Length - 1) : word; PhraseDTO phrase = new PhraseDTO { Frase = word, DataAlteracao = DateTime.Now, UserId = cookie.Name }; Debug.WriteLine($"{phrase.Frase} \n {phrase.DataAlteracao} \n {phrase.Id} \n {phrase.UserId}"); if (PhraseBLL.GetPhrase(cookie.Name).Id != "null") { ok = PhraseBLL.Update(phrase); } else { ok = PhraseBLL.Insert(phrase); } return(Json(new { ok, url = Url.Action("Configuracao", "Configuracao") }, JsonRequestBehavior.AllowGet)); }