Thinktecture.Tools.Web.Services.CodeGeneration.CollectionTypeProvider.CreateCollectionType C# (CSharp) Method

CreateCollectionType() public method

public CreateCollectionType ( CodeTypeReference entityType, ExtendedCodeDomTree code ) : CodeTypeReference
entityType System.CodeDom.CodeTypeReference
code ExtendedCodeDomTree
return System.CodeDom.CodeTypeReference
        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;
        }