Пример #1
0
        public static void Bind <TSource, TTarget>(Action <IBindingConfig <TSource, TTarget> > config = null)
        {
            TypePair typePair = TypePair.Create <TSource, TTarget>();

            if (config == null)
            {
                Bind(typePair);
            }
            else
            {
                var bindingConfig = new BindingConfig <TSource, TTarget>();
                config(bindingConfig);
                BindingConfig.Add(typePair, bindingConfig);
                CustomMapper.Remove(typePair);
                targetMapperBuilder.Build(typePair);
            }
        }
Пример #2
0
 internal static void Bind(TypePair typePair)
 {
     BindingConfig.Add(typePair, null);
     CustomMapper.Remove(typePair);
     targetMapperBuilder.Build(typePair);
 }