Exemplo n.º 1
0
 public void UpdateMatch(match match)
 {
     using (var db = new fightClubEntities())
     {
         var oldMatch = db.match.Single(a => a.id == match.id);
         if (oldMatch == null)
         {
             throw new Exception("not found");
         }
         db.Entry(oldMatch).CurrentValues.SetValues(match);
         db.SaveChanges();
     }
 }
Exemplo n.º 2
0
 public user UpdateUser(user user)
 {
     using (var db = new fightClubEntities())
     {
         var dbuser = db.user.Single(a => a.id == user.id);
         if (dbuser == null)
         {
             throw new Exception("not found");
         }
         db.Entry(dbuser).CurrentValues.SetValues(user);
         db.SaveChanges();
         return(dbuser);
     }
 }