static void oldEntityUpdate() { PayUserRepository payUserRepository = new PayUserRepository(new PayEntities()); Users user = payUserRepository.Find(i => i.ID == 1); user.PassWord = "******"; payUserRepository.Modify(user, i => i.PassWord); }
static void newEntityUpdate() { PayUserRepository payUserRepository = new PayUserRepository(new PayEntities()); payUserRepository.Modify(new Users { ID = 1, PassWord = "******" + DateTime.Now, }, i => i.PassWord); }
static void oldEntityFindAndNewUpdate() { PayUserRepository payUserRepository = new PayUserRepository(new PayEntities()); Users user = payUserRepository.Find(i => i.ID == 1); payUserRepository.Modify(new Users { ID = 1, PassWord = "******" + DateTime.Now, }, i => i.PassWord); }