コード例 #1
0
        public IValueRangeTable Compile()
        {
            if (!_baseTables.Any())
            {
                throw new InvalidOperationException("At least one base table must be provided");
            }
            var ranges = ValueRangeCompiler.Compile(_baseTables.ToArray(), _inclusions.ToArray(), _removals.ToArray());

            return(new ValueRangeTable(ranges));
        }
コード例 #2
0
        public IMappingTable Compile()
        {
            if (!_baseTables.Any() && !_inclusions.Any() && !_valueRangeBaseTables.Any())
            {
                throw new InvalidOperationException("At least one table must be provided");
            }
            var mappingTables = new List <IMappingTable>
            {
                new DictionaryMappingTable(MappingTableCompiler.Compile(_baseTables.ToArray(), _inclusions.ToArray(),
                                                                        _removals.ToArray()))
            };

            foreach (var t in _valueRangeBaseTables)
            {
                var valueRangeTable = ValueRangeCompiler.Compile(new[] { t.Item1 }, new int[0], _removals.ToArray());
                mappingTables.Add(new ValueRangeMappingTable(new ValueRangeTable(valueRangeTable), t.Item2));
            }

            return(new CompositeMappingTable(mappingTables));
        }