Пример #1
0
 public string DeleteUser(int id)
 {
     using (var db = new UserRegistrationEntities1())
     {
         Developer dev = db.Developers.Find(id);
         db.Developers.Remove(dev);
         db.SaveChanges();
     }
     return("Delete " + id);
 }
Пример #2
0
 public string PutUser(int id, UserTO oldUser)
 {
     using (var db = new UserRegistrationEntities1())
     {
         Developer dev = db.Developers.Find(id);
         dev.password = oldUser.password;
         dev.username = oldUser.username;
         db.SaveChanges();
     }
     return(oldUser.username);
 }
Пример #3
0
 public string PostUser(UserTO newUser)
 {
     using (var db = new UserRegistrationEntities1())
     {
         Developer dev = new Developer();
         dev.username = newUser.username;
         dev.password = newUser.password;
         db.Developers.Add(dev);
         db.SaveChanges();
     }
     return(newUser.username);
 }