批量插入如何插入指定列? 返回

SqlSugar 老数据
5 2270

批量插入或更新时,如果插入指定的列?

热忱回答(5)

  • .InsertColumns(it => new { it.Name, it.SchoolId })

    0 回复
  • @fate stay night:你好,批量插入Insertable是个List,并不能访问到实体的属性。

    Db.Insertable< HouseRecoveryDetail>(data.Details).InsertColumns(it => ???这里如何指定??)

    0 回复
  • 不试试肿么知道呢

    0 回复
  • @fate stay night:it点出来的是List类型数据对应的方法,求大神指导

    0 回复
  • 大哥啊你动手了没有?


      var t10 = db.Insertable(insertObjs.ToList()).InsertColumns(it => new { it.Name }).ExecuteCommand(); 我怎么点的出来的???

    0 回复