Skip to content

Commit f4eb109

Browse files
tdykstraCopilot
andauthored
Fix syntax error in example in model-binding.md (#34738)
* Fix syntax error in example in model-binding.md * Update aspnetcore/mvc/models/model-binding.md Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
1 parent a296e02 commit f4eb109

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

aspnetcore/mvc/models/model-binding.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -524,11 +524,14 @@ POCOs that do not have parameterless constructors can't be bound.
524524
The following code results in an exception saying that the type must have a parameterless constructor:
525525

526526
```csharp
527-
public class Person(string Name)
528-
527+
public class Person {
528+
public Person(string Name) { }
529+
}
529530
public record Person([Required] string Name, [Range(0, 100)] int Age)
530531
{
531-
public Person(string Name) : this (Name, 0);
532+
public Person(string Name) : this (Name, 0)
533+
{
534+
}
532535
}
533536
```
534537

0 commit comments

Comments
 (0)