OrchardCore
OrchardCore copied to clipboard
Add events before and after handling bulk imports
Scene:
- Process the data before bulk import
- Batch update dynamic SQL indexes after batch import
I am using FreeSql as an ORM tool that supports dictionary type data insertion/update (including batch mode) http://www.freesql.net/en/guide/insert-or-update.html#_2-ifreesql-insertorupdatedict
var dic = new Dictionary<string, object>();
dic.Add("id", 1);
dic.Add("name", "xxxx");
fsql.InsertOrUpdateDict(dic).AsTable("table1").WherePrimary("id").ExecuteAffrows();
related: https://github.com/OrchardCMS/OrchardCore/issues/8869