Ejemplo n.º 1
0
        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();
                }
            }
        }
Ejemplo n.º 2
0
        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();
            }
        }