I suggest you ...

Allow Join with UpdateOnly

Trying to UpdateOnly, when onlyField is typed as SqlExpression and the query has a Join an error will be thrown that says "The multi-part identifier "DepartmentJobCode.DepartmentId" could not be bound."

Example:
var jobsQuery = _db.From<dev.ScheduleEvent>()
.Join<dev.DepartmentJobCode>((se,jc)=> se.Job == jc.JobTitleId)
.Where<dev.DepartmentJobCode>(e => Sql.In(e.DepartmentId, departments))
.Update(x => new { x.Published, x.ModifiedBy});
db.UpdateOnly(new dev.ScheduleEvent { Published = false, ModifiedBy = userId}, onlyFields: jobsQuery);

3 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Tamer H. Naana shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    0 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base