Skip to content
陈珙 edited this page Mar 25, 2019 · 5 revisions

Complete Demo

using (var con = new SqlConnection("Data Source=192.168.13.46;Initial Catalog=SkyChen;Persist Security Info=True;User ID=sa;Password=123456789"))
{
    con.CommandSet<SysUser>().Insert(new SysUser
    {
        CreateDatetime = DateTime.Now,
        Email = "287245177@qq.com",
        SysUserid = Guid.NewGuid().ToString("N"),
        UserName = "chengong",
    });

    var model = con.QuerySet<SysUser>().Where(a => a.Email == "287245177@qq.com").Get();

    con.CommandSet<SysUser>().Where(a => a.SysUserid == model.SysUserid)
        .Update(a => new SysUser { Email = "2548987@qq.com" });

    con.CommandSet<SysUser>().Where(a => a.SysUserid == model.SysUserid).Delete();
}
Clone this wiki locally