コード例 #1
0
        private PropertyValue GetPropertyValue(PropertyMapping mapper, Func <int, bool> funcIsNull, Func <int, object> funcGetValue, Func <bool, PropertyValue> funcRead)
        {
            var isNull = funcIsNull(mapper.Index);

            if (mapper.Property.Type.IsArray &&
                mapper.Property.Type.GetElementType() == typeof(byte))
            {
                return(isNull ? new byte[0] : (byte[])funcGetValue(mapper.Index));
            }

            if (mapper.Property.Type.IsEnum)
            {
                return(GetEnumValue(mapper, isNull, funcGetValue));
            }

            if (PropertyValue.IsSupportedType(mapper.Property.Type))
            {
                return(funcRead(isNull));
            }

            return(GetConvertedValue(mapper, isNull, funcGetValue));
        }