Subsonic 增删改
增
DAL.User uModel = new DAL.User();
uModel.UserName = string.Format("{0}{1}", u.UserName, i);
uModel.Expire = DateTime.Now;
uModel.Password = string.Empty;
uModel.UserName = string.Format("{0}{1}", u.UserName, i);
uModel.Expire = DateTime.Now;
uModel.Password = string.Empty;
uModel.Save();
new Insert().Value(DAL.UsersTable.UserNameColumn, "admin").Execute();
改
DAL.User uModel = new DAL.User(uuu=>uuu.Id == 1);
uModel.UserName = string.Format("{0}{1}", u.UserName, i);
uModel.Expire = DateTime.Now;
uModel.Password = string.Empty;
uModel.Save();
new Update("Users").Set("UserName").EqualTo("admin")
.Where<DAL.User>(uuu=>uuu.Id == 1)
.Where<DAL.User>(uuu=>uuu.Id == 1)
.SetExpression("Count").EqualTo(" Count + 1 ")
.Execute();
删
DAL.User.Delete(uuu => uuu.Id == 1);
SqlQuery q = new SqlQuery().Where(DAL.UsersTable.IdColumn).In(1, 2);
q.QueryCommandType = QueryType.Delete;
q.Execute();