Пример #1
0
    public string NewCollection(string length)
    {
        if (!IsCollection)
        {
            throw new InvalidOperationException();
        }

        return(CollectionType.EndsWith("[]") ?
               $"new {Type}[{length}]" :
               $"new {CollectionType}({length})");
    }