Beispiel #1
0
        internal async Task <IValueAD> GetValueADAsync(MdHeadPermissionSettings permissionSettings = null)
        {
            var db = await GetDatabase("theDb", permissionSettings);

            var mdHead = await CreateNodeAsync();

            return(new DataTree(mdHead, (s) => throw new ArgumentOutOfRangeException("Can only add 999k items to this collection.")));
        }
Beispiel #2
0
 public Task <Result <IStreamDb> > GetOrAddDbAsync(string dbId, MdHeadPermissionSettings permissionSettings = null)
 => _dbFactory.CreateForApp(_appId, dbId, permissionSettings);
Beispiel #3
0
        internal async Task <IStreamDb> GetDatabase(string dbName, MdHeadPermissionSettings permissionSettings = null)
        {
            var res = await _dbFactory.CreateForApp(_appId, dbName, permissionSettings);

            return(res.Value);
        }
Beispiel #4
0
        internal async Task <IStreamAD> GetStreamADAsync(string streamKey = "theStream", MdHeadPermissionSettings permissionSettings = null)
        {
            var db = await GetDatabase("theDb", permissionSettings);

            await db.AddStreamAsync(streamKey);

            return((await db.GetStreamAsync(streamKey)).Value);
        }
Beispiel #5
0
        public async Task <Result <IStreamDb> > CreateForApp(string appId, string dbId, MdHeadPermissionSettings permissionSettings = null)
        {
            var manager = new MdHeadManager(_dataOps, NodeFactory, appId, DataProtocol.DEFAULT_AD_PROTOCOL, permissionSettings);
            await manager.InitializeManager();

            var streamDbHead = await manager.GetOrAddHeadAsync(dbId);

            var dbResult = await GetOrAddAsync(streamDbHead);

            return(dbResult);
        }