Exemplo n.º 1
0
        private void ReportConstraintViolation(
            string message,
            BoolExpression extraConstraint,
            ViewGenErrorCode errorCode,
            IEnumerable <LeftCellWrapper> relevantWrappers)
        {
            if (ErrorPatternMatcher.FindMappingErrors(this._viewgenContext, this._domainMap, this._errorLog))
            {
                return;
            }
            extraConstraint.ExpensiveSimplify();
            HashSet <LeftCellWrapper> leftCellWrapperSet = new HashSet <LeftCellWrapper>(relevantWrappers);

            new List <LeftCellWrapper>((IEnumerable <LeftCellWrapper>)leftCellWrapperSet).Sort(LeftCellWrapper.OriginalCellIdComparer);
            StringBuilder builder = new StringBuilder();

            builder.AppendLine(message);
            RewritingValidator.EntityConfigurationToUserString(extraConstraint, builder);
            this._errorLog.AddEntry(new ErrorLog.Record(errorCode, builder.ToString(), (IEnumerable <LeftCellWrapper>)leftCellWrapperSet, ""));
        }
        private void ReportConstraintViolation(
            string message, BoolExpression extraConstraint, ViewGenErrorCode errorCode, IEnumerable <LeftCellWrapper> relevantWrappers)
        {
            if (ErrorPatternMatcher.FindMappingErrors(_viewgenContext, _domainMap, _errorLog))
            {
                return;
            }

            extraConstraint.ExpensiveSimplify();
            // gather all relevant cell wrappers and sort them in the original input order
            var relevantCellWrappers = new HashSet <LeftCellWrapper>(relevantWrappers);
            var relevantWrapperList  = new List <LeftCellWrapper>(relevantCellWrappers);

            relevantWrapperList.Sort(LeftCellWrapper.OriginalCellIdComparer);

            var builder = new StringBuilder();

            builder.AppendLine(message);
            EntityConfigurationToUserString(extraConstraint, builder);
            _errorLog.AddEntry(new ErrorLog.Record(errorCode, builder.ToString(), relevantCellWrappers, ""));
        }