c# - Bulk update in SQL database using generic class object -


i working c#.net application.. wanted update bluck of records in database particular chunk or batch.. in code maintaining generic class object collection , needs update database in chunk..

list<testrecord> recordcollection = new list<testrecord>(); recordcollection.add(new testrecord(id = 1,name = 'test',body = 'html')) recordcollection.add(new testrecord(id = 2,name = 'test2',body = 'html2'))  maintaining batches 3000 records set chunk of data updation.  if(recordcollection.count > 3000) {  == update record set in database using single update query.. } 

i have searched few of method bluck update below,

  1. creating datacontext.

  2. creating linq sql

  3. using userdefinetable type, method require datatable instead generic class.

is there direct method can directly use generic object collection ? scenario mentioned in above code.

and if there no direct way bluck update using generic class best way use case.

please advise.

thanks


Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -