public CodeTypeReference CreateCollectionType(CodeTypeReference entityType, ExtendedCodeDomTree code)
{
Debug.Assert(entityType != null, "Argument entityType could not be null.");
// Do not create a ByteCollection as this is not compatiable with base64Binary!
if (entityType.BaseType == typeof(byte).FullName) return entityType;
CodeTypeDeclaration collectionType = GenerateCollectionType(entityType);
code.DataContracts.Add(new CodeTypeExtension(collectionType));
CodeTypeReference collectionRef = new CodeTypeReference(collectionType.Name);
return collectionRef;
}