예제 #1
0
        public async Task <IQueryable <CassandraRole> > GetAllRoles()
        {
            Exception ex = null;
            IQueryable <CassandraRole> result = await TryWithAwaitInCatch.ExecuteAndHandleErrorAsync <IQueryable <CassandraRole> >(
                async() =>
            {
                await EstablishSession();
                return(await _resilientSession.GetAllRoles());
            },
                async (e) =>
            {
                ex = e;
                return(new TryWithAwaitInCatchExcpetionHandleResult <IQueryable <CassandraRole> >
                {
                    RethrowException = true,
                    DefaultResult = null
                });
            }
                );

            return(result);
        }