EFUtility.CodeGenerationTools.MetadataTools.GetElementType C# (CSharp) Method

GetElementType() public method

If the passed in TypeUsage represents a collection this method returns final element type of the collection, otherwise it returns the value passed in.
public GetElementType ( TypeUsage typeUsage ) : TypeUsage
typeUsage TypeUsage
return TypeUsage
        public TypeUsage GetElementType(TypeUsage typeUsage)
        {
            if (typeUsage == null)
            {
                return null;
            }

            if (typeUsage.EdmType is CollectionType)
            {
                return GetElementType(((CollectionType)typeUsage.EdmType).TypeUsage);
            }
            else
            {
                return typeUsage;
            }
        }