public static object ConvertEnumerableToCollection(object value, string convertToTypeName) { if (value != null && TypeSystem.ContainsEnumerableInterface(value.GetType())) { TypeWrapper typeWrapper = new TypeWrapper(convertToTypeName); value = TypeSystem.ConvertEnumerableToCollection(value, typeWrapper.Value); } return(value); }
public static object ConvertEnumerableToCollection(object value, Type convertToType) { if (value != null && value.GetType() != convertToType && TypeSystem.ContainsEnumerableInterface(value.GetType())) { object obj = (value as IEnumerable).ConvertTo(convertToType); if (obj != null) { value = obj; } } return(value); }
internal static object ResolveUpdatableObjectList(object list) { if (list == null || !TypeSystem.ContainsEnumerableInterface(list.GetType())) { return(list); } else { IEnumerable enumerable = list as IEnumerable; ArrayList arrayLists = new ArrayList(); foreach (object obj in enumerable) { arrayLists.Add(EntityUpdate.ResolveUpdatableObject(obj)); } return(arrayLists); } }