I would like to use Bulk Update in this way

Query.All<RegInvestmentAnalytic>()
    .Where(a => a.DebitCredit == DebitCredit.Debit)
    .Set(x => x.Posting.FinDebit, x => x.FinTool)
    .Update();

but it fails with

System.NullReferenceException: Object reference not set to an instance of an object.
at Xtensive.Orm.BulkOperations.SetOperation`1.<PreprocessStructures>b__1(SetDescriptor a)
at System.Linq.Enumerable.WhereListIterator`1.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at Xtensive.Orm.BulkOperations.SetOperation`1.PreprocessStructures()
at Xtensive.Orm.BulkOperations.BulkUpdateOperation`1..ctor(IUpdatable`1 query)
at Xtensive.Orm.BulkOperations.BulkExtensions.Update[T](IUpdatable`1 query)

It would be great if I could use updatable field with navigation.

I could not invert this in case of one-to-many relations

asked Apr 10 '15 at 09:23

pil0t's gravatar image

pil0t
207575763


One Answer:

Hello pil0t

That would be great. But Set<t>() allows to set values only for direct fields of T type for now. In future I thing we'll implement usage of update like in your case, but I can't tell you concrete version in which we implement it.

answered Apr 15 '15 at 05:56

Alexey%20Kulakov's gravatar image

Alexey Kulakov
77225

Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

Subscription:

Once you sign in you will be able to subscribe for any updates here

Tags:

×52
×3
×2

Asked: Apr 10 '15 at 09:23

Seen: 4,607 times

Last updated: Apr 15 '15 at 05:56

powered by OSQA