Exemple #1
0
        public async Task <IEnumerable <ITokenMetadata> > GetAllAsync(string subject)
        {
            var result = await TryWithAwaitInCatch.ExecuteAndHandleErrorAsync(
                async() =>
            {
                await ResilientSessionContainer.EstablishSessionAsync();
                var clientStore = new ClientStore();
                var scopeStore  = new ScopeStore();
                return
                (await
                 ResilientSessionContainer.ResilientSession.FindAuthorizationCodeMetadataBySubject(subject,
                                                                                                   clientStore, scopeStore));
            },
                async (ex) => ResilientSessionContainer.HandleCassandraException <IEnumerable <ITokenMetadata> >(ex));

            return(result);
        }
Exemple #2
0
        public async Task <AuthorizationCode> GetAsync(string key)
        {
            var result = await TryWithAwaitInCatch.ExecuteAndHandleErrorAsync(
                async() =>
            {
                await ResilientSessionContainer.EstablishSessionAsync();
                var clientStore = new ClientStore();
                var scopeStore  = new ScopeStore();
                return
                (await
                 ResilientSessionContainer.ResilientSession.FindAuthorizationCodeByKey(key, clientStore,
                                                                                       scopeStore));
            },
                async (ex) => ResilientSessionContainer.HandleCassandraException <AuthorizationCode>(ex));

            return(result);
        }