コード例 #1
0
 public JsonResult MakeFalse()
 {
     CookingSiteDBEntities db = new CookingSiteDBEntities();
     var relaceQuery          =
         from key in db.Terms
         where key.IsMatch == true
         select key;
コード例 #2
0
        //This method is called by a JSON method in the terms controller and sets the IsMatch bool in the terms table to false.
        public JsonResult MakeFalse()
        {
            CookingSiteDBEntities db = new CookingSiteDBEntities();
            var relaceQuery          =
                from key in db.Terms
                where key.IsMatch == true
                select key;

            foreach (Term key in relaceQuery)
            {
                if (key.IsMatch == true)
                {
                    key.IsMatch = false;
                }
            }
            db.SaveChanges();
            return(new JsonResult());
        }