public async Task CreateCollection() { string databaseName = ProgramHelper.ReadDatabaseName(); string collectionName = ProgramHelper.ReadCollectionName(); ProgramHelper.Divider(); DocumentCollection documentCollection = await _collectionRepository.CreateCollection(databaseName, collectionName); InfoAboutCollection(documentCollection); }
public async Task DeleteCollection() { string databaseName = ProgramHelper.ReadDatabaseName(); string collectionName = ProgramHelper.ReadCollectionName(); bool deleteResult = await _collectionRepository.DeleteCollection(databaseName, collectionName); if (deleteResult) { Success("Collection >>> " + collectionName + " <<< deleted."); } else { Error("Collection >>> " + collectionName + " <<< was not deleted."); } }
public bool InsertCollAndDatabase(ref string databaseName, ref DocumentCollection collectionName) { databaseName = ProgramHelper.ReadDatabaseName(); string collectionId = ProgramHelper.ReadCollectionName(); bool ifCollectionExist = _collectionRepository.CheckIfCollectionExistAsync(databaseName, collectionId); if (ifCollectionExist) { collectionName = _collectionRepository.GetDocumentCollection(databaseName, collectionId); return(true); } collectionName = new DocumentCollection() { Id = collectionId }; return(false); }