Nettiers.AdventureWorks.Entities.EntityUtil.GetEntityList C# (CSharp) Method

GetEntityList() public static method

Converts the specified object into a collection of objects.
public static GetEntityList ( Object entityList ) : IList
entityList Object An object instance.
return IList
		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;
		}

Same methods

EntityUtil::GetEntityList ( Object entity, String propertyName ) : IList