Skip to content

Commit d24bf4a

Browse files
authored
Add template with code in a Main method (#647)
This will allow for examples which are just statements. (Also adds example in 16.1 Arrays to show how to use it.) Towards #646
1 parent d6254c5 commit d24bf4a

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

standard/arrays.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ The element type of an array can itself be an array type ([§16.2.1](arrays.md#1
1010

1111
> *Example*:
1212
>
13+
> <!-- Example: {template:"code-in-main", name:"PascalArrayDeclarations"} -->
1314
> ```csharp
1415
> int[][] pascals =
1516
> {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class Program
2+
{
3+
static void Main()
4+
{
5+
$example-code
6+
}
7+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net6.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>disable</Nullable>
8+
<AssemblyName>$example-name</AssemblyName>
9+
</PropertyGroup>
10+
11+
</Project>

0 commit comments

Comments
 (0)