public void SaveUserTest()
        {
            User user = new User();
            user.Age = 25;
            user.Name = "胡浩";
            user.Sex = "男";

            string generateId = sample.SaveUser(user);
            Console.WriteLine(generateId);
        }
 public void SaveOrUpdateUser(User user)
 {
     _session.SaveOrUpdate(user);
     _session.Flush();
 }
 public string SaveUser(User user)
 {
     return _session.Save(user).ToString();
 }
 public void DelUserById(User user)
 {
     _session.Delete(user);
     _session.Flush();//刷新session缓存,保持与数据库的同步
 }