I'm writing a desktop client that allows the user to upload a spreadsheet with products.
The spreadsheet is then parsed by the API and products are either created or updated and saved using the ContentService.
Since this process is really slow my first solution was to set the timeout of the client webrequest to 5 minutes, but i don't like that solution.
Instead i want to make the creation/updates in another thread. This solution i can not get to work since i get an ArgumentNullException when using ContentService.Save(IList
A snipppet of my current code:
var items = parser.Parse(); // Parse spreadsheet
new Task(() =>
{
var products = new List<IContent>();
for (var item in items)
{
if (item.IsValid())
{
var product = CreateOrUpdateProduct(parentId, item);
products.Add(product);
}
}
ApplicationContext.Current.Services.ContentService.Save(products);
).Start();
Save IContent from another thread
Hi
I'm writing a desktop client that allows the user to upload a spreadsheet with products. The spreadsheet is then parsed by the API and products are either created or updated and saved using the ContentService.
Since this process is really slow my first solution was to set the timeout of the client webrequest to 5 minutes, but i don't like that solution. Instead i want to make the creation/updates in another thread. This solution i can not get to work since i get an ArgumentNullException when using ContentService.Save(IList
A snipppet of my current code:
Is it possible to do this?
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.