public async Task <dynamic> Get(string entityName, string idKey, string idDocument) { IStoragePersistent storagePersistentCosmosDB = new StoragePersistentCosmosDB(); await storagePersistentCosmosDB.Connect(); var documentStorage = storagePersistentCosmosDB.QueryDocumentEntity("ExternalConsulting", entityName, entityName + "." + idKey, idDocument); var document = JsonConvert.SerializeObject(documentStorage); return(Ok(document)); }
// ADD THIS PART TO YOUR CODE private async Task GetStartedDemo() { IStoragePersistent storagePersistentCosmosDB = new StoragePersistentCosmosDB(); await storagePersistentCosmosDB.Connect(); //await storagePersistentCosmosDB.CreateDatabase("ExternalConsulting"); //await storagePersistentCosmosDB.CreateEntity("ExternalConsulting", "RecordPatientCollection"); //string document = "{'id':'1','nombre':'ABRAHAN URIEL OLAUA','tipoIdentificacion':'CC','numeroIdentificacion':91533079,'edad':34,'peso':74.0,'masaCorporal':24.8,'superficieCorporal':1.9,'genero':'M','identificador':57977,'talla':174.0,'grupoSanguineo':'O + '}"; //await storagePersistentCosmosDB.CreateDocumentEntity("ExternalConsulting", "RecordPatientCollection",document); dynamic documento = storagePersistentCosmosDB.QueryDocumentEntity("ExternalConsulting", "IndexationCollection", "IndexationCollection.idEpisodio", "397497898"); string doc = JsonConvert.SerializeObject(documento); Console.WriteLine(doc); }