C# object转List

            IEnumerable list = ListValue as IEnumerable;

            if (list != null)
            {
                foreach (var item in list)
                {
                    if (value.Equals(item.GetType().GetProperty(PropertyName).GetValue(item, null).ToString()))
                    {
                        result = item.GetType().GetProperty(CheckPropertyName).GetValue(item, null).ToString();
                    }
                }
            } 
  

 

你可能感兴趣的:(C#)