|
@@ -419,10 +419,16 @@ namespace TEAMModelOS.Controllers
|
|
|
try
|
|
|
{
|
|
|
var client = _azureCosmos.GetCosmosClient();
|
|
|
- List<string> id = ids.ToObject<List<string>>();
|
|
|
+ //List<string> id = ids.ToObject<List<string>>();
|
|
|
+ string info = "";
|
|
|
+ for (int i = 0; i < ids.GetArrayLength(); i++)
|
|
|
+ {
|
|
|
+ //ids.Add(id[i].ToJsonString());
|
|
|
+ info += ids[i].ToJsonString() + ",";
|
|
|
+ }
|
|
|
List<object> ClassName = new List<object>();
|
|
|
await foreach (var item in client.GetContainer("TEAMModelOS", "Teacher").GetItemQueryStreamIterator(
|
|
|
- queryText: $"select c.id,c.name from c where c.id in '{id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Class-{code}") }))
|
|
|
+ queryText: $"select c.id,c.name from c where c.id in ({info[0..^1]})", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Class-{code}") }))
|
|
|
{
|
|
|
using var json = await JsonDocument.ParseAsync(item.ContentStream);
|
|
|
if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
|