Skip to content

Bulk Update using UpdateBuilder #3141

Answered by bahusoid
satishviswanathan asked this question in Q&A
Discussion options

You must be logged in to vote

Not sure what i'm missing here.

Updates on association entities (y.Score.Performance) are not supported.

As a workaround you can try to rewrite this DML using subquery. Something like:

IQueryable<Score> scoreToUpdateSubQuery = session.Query<Employee>().Where(x => x.Name.StartsWith("sa")).Select(e => e.Score);
await session.Query<Score>()
  .Where(e => scoreToUpdateSubQuery.Contains(e))
  .UpdateBuilder().Set(s => s.Performance, 10)
  .UpdateAsync(ct).ConfigureAwait(false);

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by hazzik
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #3001 on August 29, 2022 21:51.