public ActionResult ModifyDict(T_WordDict model) { dbContent.Entry(model).State = EntityState.Modified; dbContent.SaveChanges(); Refresh(); return(Ok()); }
public ActionResult SetDict(T_WordDict model) { var dict = dbContent.WordDicts.FirstOrDefault(x => x.Word == model.Word && x.LanguageId == model.LanguageId); if (dict == null) { dbContent.Entry(model).State = EntityState.Added; } else { dict.Value = model.Value; } dbContent.SaveChanges(); Refresh(); return(Ok()); }