public MemberMetadata(MemberInfo memberInfo)
        {
            _type = MemberType.None;
            _memberType = null;
            _mi = null;
            _fp = null;

            memberInfo.ThrowIfNull("memberInfo", "Parameter cannot be null.");
            switch (memberInfo.MemberType)
            {
                case MemberTypes.Field:
                    _type = MemberType.Field;
                    _mi = memberInfo;
                    _memberType = (memberInfo as FieldInfo).FieldType;
                    break;
                case MemberTypes.Property:
                    _type = MemberType.Property;
                    _memberType = (memberInfo as PropertyInfo).PropertyType;
                    _fp = new FastReflection.FastProperty((memberInfo as PropertyInfo), true);
                    _mi = memberInfo;
                    break;
                default:
                    break;
            }
        }
 public void Add(Type type, PropertyInfo pi)
 {
     if (!_cache.Contains(type))
     {
         _cache.Insert(type, new ConcurrentDictionary<string, FastProperty>(), CacheStrategy.Permanent);
         FastProperty pFast = new FastProperty(pi);
         _cache[type].TryAdd(pi.Name, pFast);
     }
     else if (!_cache[type].ContainsKey(pi.Name))
     {
         FastProperty pFast = new FastProperty(pi);
         _cache[type].TryAdd(pi.Name, pFast);
     }
 }