internal MappingTypeInfo(Type inputType, Type outputType) { IsArrayInput = inputType.IsArray; IsArrayOutput = outputType.IsArray; IsInputDynamic = typeof(IDynamicMetaObjectProvider).IsAssignableFrom(inputType); IsOutputDynamic = typeof(IDynamicMetaObjectProvider).IsAssignableFrom(outputType); if (!IsArray) { if (!IsOutputDynamic) { foreach (var propInfo in outputType.GetProperties()) { OutputPropertiesByName.Add(propInfo.Name, propInfo); AddAttributeInfoMapping(propInfo); } } if (!IsInputDynamic) { foreach (var propInfo in inputType.GetProperties()) { InputPropertiesByName.Add(propInfo.Name, propInfo); } } if (!IsDynamic) { CombineInputAndOutputMapping(); } } }
internal MappingTypeInfo(Type inputType, Type outputType) { IsArrayInput = inputType.IsArray; IsArrayOutput = outputType.IsArray; IsDynamic = inputType.IsDynamic() || outputType.IsDynamic(); if (!IsArray && !IsDynamic) { foreach (var propInfo in outputType.GetProperties()) { AddAttributeInfoMapping(propInfo); } foreach (var propInfo in inputType.GetProperties()) { InputPropertiesByName.Add(propInfo.Name, propInfo); } CombineInputAndOutputMapping(); } }