|
@@ -609,27 +609,33 @@ namespace TEAMModelOS.SDK
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
+ List<Task<ItemResponse<StuActivity>>> tasks = new List<Task<ItemResponse<StuActivity>>>();
|
|
|
if (stuActivities.IsNotEmpty())
|
|
|
{
|
|
|
foreach (var x in stuActivities)
|
|
|
{
|
|
|
- await client.GetContainer(Constant.TEAMModelOS, "Student").UpsertItemAsync(x, new PartitionKey(x.code));
|
|
|
+ tasks.Add(client.GetContainer(Constant.TEAMModelOS, "Student").UpsertItemAsync(x, new PartitionKey(x.code)));
|
|
|
}
|
|
|
}
|
|
|
if (tmdActivities.IsNotEmpty())
|
|
|
{
|
|
|
foreach (var x in tmdActivities)
|
|
|
{
|
|
|
- await client.GetContainer(Constant.TEAMModelOS, "Student").UpsertItemAsync(x, new PartitionKey(x.code));
|
|
|
+ tasks.Add(client.GetContainer(Constant.TEAMModelOS, "Student").UpsertItemAsync(x, new PartitionKey(x.code)));
|
|
|
}
|
|
|
}
|
|
|
if (tchActivities.IsNotEmpty())
|
|
|
{
|
|
|
foreach (var x in tchActivities)
|
|
|
{
|
|
|
- await client.GetContainer(Constant.TEAMModelOS, "Teacher").UpsertItemAsync(x, new PartitionKey(x.code));
|
|
|
+ tasks.Add(client.GetContainer(Constant.TEAMModelOS, "Student").UpsertItemAsync(x, new PartitionKey(x.code)));
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ if (tasks.Count > 0)
|
|
|
+ {
|
|
|
+ await tasks.TaskPage(50);
|
|
|
+ }
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|