Ejemplo n.º 1
0
 public ActionResult ModifyDict(T_WordDict model)
 {
     dbContent.Entry(model).State = EntityState.Modified;
     dbContent.SaveChanges();
     Refresh();
     return(Ok());
 }
Ejemplo n.º 2
0
        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());
        }