|
@@ -1263,8 +1263,32 @@ namespace TEAMModelBI.Controllers.BITest
|
|
|
return Ok(new { state = 200, linqTests, set });
|
|
|
}
|
|
|
|
|
|
+ [HttpPost("get-cosmosdb")]
|
|
|
+ public async Task<IActionResult> GetMany()
|
|
|
+ {
|
|
|
+ var cosmos = _configuration.GetValue<string>("Azure:Cosmos:ConnectionString");
|
|
|
+
|
|
|
+
|
|
|
+ var clientUrl = _configuration.GetValue<string>("Azure:CosmosUrl:ConnectionString");
|
|
|
+ var clientKey = _configuration.GetValue<string>("Azure:CosmosKey:ConnectionString");
|
|
|
|
|
|
|
|
|
+ CosmosClient cosmosClient = new(clientUrl, clientKey);
|
|
|
+ //var cosmosClient = _azureCosmos.GetCosmosClient(region:client,name: cosmos);
|
|
|
+
|
|
|
+ var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync("hbcn", new PartitionKey("Base"));
|
|
|
+ School school = new();
|
|
|
+ if (response.Status == 200)
|
|
|
+ {
|
|
|
+ using var json = await JsonDocument.ParseAsync(response.ContentStream);
|
|
|
+ school = json.ToObject<School>();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ return Ok(new { state = 200, school });
|
|
|
+ }
|
|
|
+
|
|
|
public class linqTest
|
|
|
{
|
|
|
public string id{ get; set; }
|