Beispiel #1
0
        public void Validate(TypeMapBase map, IEnumerable<TypeMapBase> maps)
        {
            if (!rootValidators.ContainsKey(map.GetType()))
            {
                Error.MapValidationException_TypeMapIsNotSupported(map);
            }

            var obj = new MapValidator.ValidationContext
            {
                Map = map,
                CurrentNode = map,
                ParentNode = maps
            };

            rootValidators[map.GetType()](obj);
        }
Beispiel #2
0
        public MapCompiler.CompilationResult Compile(TypeMapBase map, string contextualName)
        {
            if (!rootCompilers.ContainsKey(map.GetType()))
            {
                Error.MapValidationException_TypeMapIsNotSupported(map);
            }

            var arg = new MapCompiler.CompilationContext
            {
                Map = map,
                CurrentNode = map,
                ParentNode = null,
                ContextualName = contextualName
            };

            return rootCompilers[map.GetType()](arg);
        }