public static IList GetEntityList(Object entityList)
{
IList list = null;
if ( entityList == null )
{
list = new ArrayList();
}
else
{
if ( entityList is IList )
{
list = (IList) entityList;
}
else
{
list = new ArrayList();
if ( entityList is IEnumerable )
{
IEnumerable temp = entityList as IEnumerable;
foreach ( Object item in temp )
{
if ( item != null )
{
list.Add(item);
}
}
}
else
{
list.Add(entityList);
}
}
}
return list;
}