示例#1
0
        private void EnsureMapperType(Type sourceType, Type targetType, ModuleBuilder builder)
        {
            var key = Triplet.Create(_container, sourceType, targetType);

            if (!_genericMapperTypes.ContainsKey(key))
            {
                lock (_genericMapperTypes)
                {
                    if (!_genericMapperTypes.ContainsKey(key))
                    {
                        _genericMapperTypes.Add(key, CreateMapper(builder, sourceType, targetType));
                    }
                }
            }
        }
示例#2
0
 private void EnsureMapperType(Type sourceType, Type targetType, ModuleBuilder builder)
 {
     _genericMapperTypes.GetOrAdd(Triplet.Create(_container, sourceType, targetType), key => CreateMapper(builder, key.Second, key.Third));
 }