示例#1
0
        public ToEntity GetModel()
        {
            ToEntity Result     = new ToEntity();
            var      AllowNames = ToPropertyNames.Where(o => !ExcludeNames.Contains(o));

            foreach (var PropertyName in AllowNames)
            {
                if (ToCache.IsListProperty(PropertyName))
                {
                    continue;
                }
                var StingValue = GetRequest(PropertyName);
                if (null == StingValue)
                {
                    continue;
                }
                try
                {
                    Type PropertyType = ToCache.PropertyDic[PropertyName].GetType();

                    SetPropertyValue(Result, PropertyName, StingValue);
                    FoundNamesCount++;
                }
                catch (Exception ex)
                {
                    x.Say(String.Format("设置属性[{0}]的值为[{1}]时候,出现了异常:{2}", PropertyName, StingValue, ex.Message));
                }
            }



            return(Result);
        }