c# - Return actual patched property value from patchcommand in RavenDb -


a have "billing" class that's describe finance account model in multithreading application. if want transfer money 1 billing make patchcommand increment 1 property , decrement another. right way return actual property value after patching without redundant load-query?

billing class

public class billing {     public string id { get; set; }     public decimal balance { get; set; } } 

my patch method

public void transfermoney(string billingsrc, string billingdst, decimal money)     {         _ctx.databasecommands.batch(new icommanddata[]         {                             new scriptedpatchcommanddata             {                 key = billingsrc,                 patch = new scriptedpatchrequest                 {                     script = @"this.balance -= money;",                     values = {{"money", money}}                 }             },             new scriptedpatchcommanddata             {                 key = billingdst,                 patch = new scriptedpatchrequest                 {                     script = @"this.balance += money;",                     values = {{"money", money}}                 }             }         });     } 

you can use output() method send values user.


Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -