Ejemplo n.º 1
0
                public bool MoveNext()
                {
                    try
                    {
                        if (_inner == null)
                        {
                            _inner = _exceptionInterceptor._innerFactory().GetEnumerator();
                        }

                        return(_inner.MoveNext());
                    }
                    catch (Exception e)
                    {
                        _exceptionInterceptor._queryContext.Logger.LogError(
                            new DatabaseErrorLogState(_exceptionInterceptor._queryContext.ContextType),
                            e,
                            (state, exception) =>
                            Strings.LogExceptionDuringQueryIteration(Environment.NewLine, exception));

                        throw;
                    }
                }
Ejemplo n.º 2
0
                public async Task <bool> MoveNext(CancellationToken cancellationToken)
                {
                    try
                    {
                        if (_inner == null)
                        {
                            _inner = _exceptionInterceptor._innerFactory().GetEnumerator();
                        }

                        return(await _inner.MoveNext(cancellationToken).WithCurrentCulture());
                    }
                    catch (Exception e)
                    {
                        _exceptionInterceptor._queryContext.Logger.LogError(
                            new DataStoreErrorLogState(_exceptionInterceptor._queryContext.ContextType),
                            e,
                            (state, exception) =>
                            Strings.LogExceptionDuringQueryIteration(Environment.NewLine, exception));

                        throw;
                    }
                }