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

            return(result);
        }