Пример #1
0
        public static void LoadBindings(string sourceFileName)
        {
            XmlMappingAdapter  xma      = new XmlMappingAdapter();
            IList <RawBinding> bindings = xma.Load(sourceFileName);

            if (bindings != null)
            {
                _mapper.ImportBindings(bindings);
            }
        }
Пример #2
0
        public static void LoadBindings()
        {
            IList <RawBinding> bindings
                = System.Configuration.ConfigurationManager.GetSection("yttrium/objects") as IList <RawBinding>;

            if (bindings == null)
            {
                FileInfo fi = new FileInfo("yttrium.mapping.config");
                if (fi.Exists)
                {
                    XmlMappingAdapter xma = new XmlMappingAdapter();
                    bindings = xma.Load(fi.FullName);
                }
            }
            if (bindings != null)
            {
                _mapper.ImportBindings(bindings);
            }
        }