<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/c-15-collection-expression-arguments-what-s-new-vs-c-12-and-13-fbrmmg1kf" -->

---
title: C# 15 Collection Expression Arguments: What's New vs C#...
description: C# 15 introduces collection expression arguments, letting developers pass constructor, factory, or builder arguments directly inside collection expression...
canonical: https://daily.dev/posts/c-15-collection-expression-arguments-what-s-new-vs-c-12-and-13-fbrmmg1kf
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: C# 15 Collection Expression Arguments: What's New vs C# 12 and 13 | daily.dev
og:description: C# 15 introduces collection expression arguments, letting developers pass constructor, factory, or builder arguments directly inside collection expression...
og:url: https://daily.dev/posts/c-15-collection-expression-arguments-what-s-new-vs-c-12-and-13-fbrmmg1kf
og:image: https://api.daily.dev/og/posts/FBRmmg1Kf.png
og:image:alt: C# 15 Collection Expression Arguments: What's New vs C# 12 and 13
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# C# 15 Collection Expression Arguments: What's New vs C# 12 and 13

**[We Are .NET](https://daily.dev/sources/wearedotnet)** · 3 min read · 9 upvotes · 1 comments

## Summary

C# 15 introduces collection expression arguments, letting developers pass constructor, factory, or builder arguments directly inside collection expression syntax using a leading with(...) element, such as [with(capacity: 100), 1, 2, 3]. This builds on C# 12's collection expressions ([...] and spread) and C# 13's expanded params collections, but focuses specifically on collection construction rather than method parameter shapes. Limitations include: with(...) must be the first element, arrays and spans are unsupported, dynamic arguments are disallowed, and with(...) arguments don't affect type inference or conversion. Normal overload resolution and ambiguity rules still apply for constructors and collection builders.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://laurentkempe.com/2026/09/26/csharp-15-collection-expression-arguments>

## Questions this post answers

### How do I pass a capacity or comparer argument when initializing a collection using C# 15 collection expressions?

Use a leading with(...) element as the first item in the collection expression, for example List<int> numbers = [with(capacity: 100), 1, 2, 3, ..more]. The with(...) arguments are forwarded to constructor binding, a collection builder's Create(...) method, or a curated interface signature, but they must appear first and cannot be dynamic or influence type inference.

_Developers adopting new C# collection syntax can track version-by-version changes like this on daily.dev._

### What is the difference between C# 13 params collections and C# 15 collection expression arguments?

C# 13 expanded the params modifier so method parameters can accept Span<T>, ReadOnlySpan<T>, and other collection interfaces beyond arrays, changing how callers pass arguments to methods. C# 15 instead changes how collections themselves are constructed, adding a with(...) first element inside [...] to supply constructor, factory, or builder arguments like capacity or comparer during initialization.

_daily.dev helps developers keep straight which C# version changed method calls versus collection construction._

### Can I use with(...) syntax with arrays or spans in C# 15 collection expressions?

No, with(...) is explicitly unsupported for arrays and spans in C# 15; it only works where constructor binding, a builder's Create(...) method, or supported interface signatures exist. Attempting to apply with(...) to an array or span target will not compile, so developers must reserve this syntax for custom collection types or interfaces that accept the extra arguments.

_Teams adopting the newest C# syntax rules can check limitations like this before refactoring on daily.dev._

## Community discussion

Top comments from developers on daily.dev.

**@ajaychoudhary80** · 2 upvotes

> Interesting evolution of collection expressions. `with(...)` makes construction options much more expressive while keeping the familiar `[ ... ]` syntax.

## Similar posts on daily.dev

- [Collection expressions with arguments in C\# 15](https://daily.dev/posts/collection-expressions-with-arguments-in-c-15-vqxccqqha) · Damir's Corner · 10 upvotes · 0 comments
- [Collection Expression Arguments Fix the Comparer Problem in C\# 15](https://daily.dev/posts/collection-expression-arguments-fix-the-comparer-problem-in-c-15-6qyslgktk) · Khalid Abuhakmeh · 1 upvotes · 0 comments
- [The best new features of C\# 14](https://daily.dev/posts/the-best-new-features-of-c-14-6gsbbjwv4) · InfoWorld · 46 upvotes · 4 comments
- [Extension Properties: C\# 14’s Game-Changer for Cleaner Code](https://daily.dev/posts/extension-properties-c-14-s-game-changer-for-cleaner-code-aawdgf4pc) · Telerik · 0 upvotes · 0 comments

---

Tags: [#.net](https://daily.dev/tags/.net), [#c#](https://daily.dev/tags/c#)

[View this post on daily.dev](https://daily.dev/posts/c-15-collection-expression-arguments-what-s-new-vs-c-12-and-13-fbrmmg1kf)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"C# 15 Collection Expression Arguments: What's New vs C# 12 and 13","url":"https://daily.dev/posts/c-15-collection-expression-arguments-what-s-new-vs-c-12-and-13-fbrmmg1kf","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/c-15-collection-expression-arguments-what-s-new-vs-c-12-and-13-fbrmmg1kf"},"datePublished":"2026-09-26T11:43:27.055Z","dateModified":"2026-09-26T11:43:50.655Z","description":"C# 15 introduces collection expression arguments, letting developers pass constructor, factory, or builder arguments directly inside collection expression...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/d656645c35fe4488e528e7706497aafa?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/d656645c35fe4488e528e7706497aafa?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"We Are .NET","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"We Are .NET","logo":"https://media.daily.dev/image/upload/s--BsnVOa3i--/f_auto/v1718347410/logos/wearedotnet","url":"https://daily.dev/sources/wearedotnet"},"commentCount":1,"discussionUrl":"https://daily.dev/posts/c-15-collection-expression-arguments-what-s-new-vs-c-12-and-13-fbrmmg1kf","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":9},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":1}],"keywords":".net,c#","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"We Are .NET","item":"https://daily.dev/sources/wearedotnet"},{"@type":"ListItem","position":3,"name":"C# 15 Collection Expression Arguments: What's New vs C# 12 and 13"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/c-15-collection-expression-arguments-what-s-new-vs-c-12-and-13-fbrmmg1kf","comment":[{"@type":"Comment","text":"Interesting evolution of collection expressions. with(...) makes construction options much more expressive while keeping the familiar [ ... ] syntax.","datePublished":"2026-09-27T09:02:40.643Z","url":"https://daily.dev/posts/FBRmmg1Kf#c-zMt19duII","author":{"@type":"Person","name":"Ajay Choudhary","url":"https://daily.dev/ajaychoudhary80","image":"https://media.daily.dev/image/upload/s--WkX8wDW2--/f_auto/v1780989706/avatars/avatar_QNZlI2SgVnNSx5PSRpCVx?_a=BAMAMiWQ0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/c-15-collection-expression-arguments-what-s-new-vs-c-12-and-13-fbrmmg1kf#faq","mainEntity":[{"@type":"Question","name":"How do I pass a capacity or comparer argument when initializing a collection using C# 15 collection expressions?","acceptedAnswer":{"@type":"Answer","text":"Use a leading with(...) element as the first item in the collection expression, for example List\u003cint\u003e numbers = [with(capacity: 100), 1, 2, 3, ..more]. The with(...) arguments are forwarded to constructor binding, a collection builder's Create(...) method, or a curated interface signature, but they must appear first and cannot be dynamic or influence type inference. Developers adopting new C# collection syntax can track version-by-version changes like this on daily.dev."}},{"@type":"Question","name":"What is the difference between C# 13 params collections and C# 15 collection expression arguments?","acceptedAnswer":{"@type":"Answer","text":"C# 13 expanded the params modifier so method parameters can accept Span\u003cT\u003e, ReadOnlySpan\u003cT\u003e, and other collection interfaces beyond arrays, changing how callers pass arguments to methods. C# 15 instead changes how collections themselves are constructed, adding a with(...) first element inside [...] to supply constructor, factory, or builder arguments like capacity or comparer during initialization. daily.dev helps developers keep straight which C# version changed method calls versus collection construction."}},{"@type":"Question","name":"Can I use with(...) syntax with arrays or spans in C# 15 collection expressions?","acceptedAnswer":{"@type":"Answer","text":"No, with(...) is explicitly unsupported for arrays and spans in C# 15; it only works where constructor binding, a builder's Create(...) method, or supported interface signatures exist. Attempting to apply with(...) to an array or span target will not compile, so developers must reserve this syntax for custom collection types or interfaces that accept the extra arguments. Teams adopting the newest C# syntax rules can check limitations like this before refactoring on daily.dev."}}]}
```

