Ejemplo n.º 1
0
        /// <summary>
        /// Gets the configuration for the specified types. Will return null if none is defined.
        /// </summary>
        internal static IMappingConfiguration GetConfiguration(Type sourceType, Type destinationType)
        {
            MapKey key = new MapKey(sourceType, destinationType);
            IMappingConfiguration configuration;

            configurationsDict.TryGetValue(key, out configuration);
            return(configuration);
        }
Ejemplo n.º 2
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (!(obj is MapKey))
            {
                return(false);
            }
            MapKey compared = (MapKey)obj;

            return(sourceType.Equals(compared.sourceType) && targetType.Equals(compared.targetType));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Checks if a configuration has been defined.
        /// </summary>
        public static bool IsConfigurationDefined(Type sourceType, Type destinationType)
        {
            MapKey key = new MapKey(sourceType, destinationType);

            return(mapDictionary.ContainsKey(key));
        }