-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
📌 seQUESTeredIdentifies that an issue has been imported into Quest.Identifies that an issue has been imported into Quest.dotnet-csharp/svcfundamentals/subsvcin-prThis issue will be closed (fixed) by an active pull request.This issue will be closed (fixed) by an active pull request.okr-qualityContent-quality KR: Concerns article defects (bugs), freshness, or build warnings.Content-quality KR: Concerns article defects (bugs), freshness, or build warnings.
Description
It would be helpful to see the official feature / syntax / name / description of using the simplified anonymous type syntax
For example the following anonymous object syntax:
var firstName = "Kyle";
var lastName = "Mit";
var person = { firstName, lastName };
Which is essentially equivalent to:
var person = { firstName = "Kyle", lastName = "Mit"};
Not sure what this feature is called: implicit property names / inferred names / simple names?
For Tuples, this is called Infer tuple names (aka. tuple projection initializers) and came out in C# 7.1 and referenced on the Tuple types page
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
- ID: d1b30ebe-b640-449b-3602-9891a55794db
- Version Independent ID: dd937177-98f0-a797-d49b-29332aae0614
- Content: Anonymous Types
- Content Source: docs/csharp/fundamentals/types/anonymous-types.md
- Product: dotnet-csharp
- Technology: csharp-fundamentals
- GitHub Login: @BillWagner
- Microsoft Alias: wiwagn
Copilot
Metadata
Metadata
Assignees
Labels
📌 seQUESTeredIdentifies that an issue has been imported into Quest.Identifies that an issue has been imported into Quest.dotnet-csharp/svcfundamentals/subsvcin-prThis issue will be closed (fixed) by an active pull request.This issue will be closed (fixed) by an active pull request.okr-qualityContent-quality KR: Concerns article defects (bugs), freshness, or build warnings.Content-quality KR: Concerns article defects (bugs), freshness, or build warnings.
Type
Projects
Status
✅ Done