You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: aspnetcore/fundamentals/index.md
+54-54Lines changed: 54 additions & 54 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,59 +18,7 @@ This article provides an overview of the fundamentals for building ASP.NET Core
18
18
19
19
For Blazor fundamentals guidance, which adds to or supersedes the guidance in this article, see <xref:blazor/fundamentals/index>.
20
20
21
-
## How to download a sample
22
-
23
-
Many of the articles and tutorials include links to sample code.
24
-
25
-
1.[Download the ASP.NET repository zip file](https://codeload.github.com/dotnet/AspNetCore.Docs/zip/main).
26
-
1. Unzip the `AspNetCore.Docs-main.zip` file.
27
-
1. To access an article's sample app in the unzipped repository, use the URL in the article's sample link to help you navigate to the sample's folder. Usually, an article's sample link appears at the top of the article with the link text *View or download sample code*.
28
-
29
-
### Preprocessor directives in sample code
30
-
31
-
To demonstrate multiple scenarios, sample apps use the `#define` and `#if-#else/#elif-#endif` preprocessor directives to selectively compile and run different sections of sample code. For those samples that make use of this approach, set the `#define` directive at the top of the C# files to define the symbol associated with the scenario that you want to run. Some samples require defining the symbol at the top of multiple files in order to run a scenario.
32
-
33
-
For example, the following `#define` symbol list indicates that four scenarios are available (one scenario per symbol). The current sample configuration runs the `TemplateCode` scenario:
34
-
35
-
```csharp
36
-
#defineTemplateCode// or LogFromMain or ExpandDefault or FilterInCode
You may safely ignore or remove the `#region` and `#endregion` directives that surround the code. Don't alter the code within these directives if you plan to run the sample scenarios described in the topic.
70
-
71
-
For more information, see [Contribute to the ASP.NET documentation: Code snippets](https://github.com/dotnet/AspNetCore.Docs/blob/main/CONTRIBUTING.md#code-snippets).
72
-
73
-
## Program.cs
21
+
## `Program.cs`
74
22
75
23
ASP.NET Core apps created with the web templates contain the application startup code in the `Program.cs` file. The `Program.cs` file is where:
76
24
@@ -288,9 +236,61 @@ In Razor `.cshtml` files, `~/` points to the web root. A path beginning with `~/
288
236
289
237
For more information, see <xref:fundamentals/static-files>.
290
238
239
+
## How to download a sample
240
+
241
+
Many of the articles and tutorials include links to sample code.
242
+
243
+
1.[Download the ASP.NET repository zip file](https://codeload.github.com/dotnet/AspNetCore.Docs/zip/main).
244
+
1. Unzip the `AspNetCore.Docs-main.zip` file.
245
+
1. To access an article's sample app in the unzipped repository, use the URL in the article's sample link to help you navigate to the sample's folder. Usually, an article's sample link appears at the top of the article with the link text *View or download sample code*.
246
+
247
+
### Preprocessor directives in sample code
248
+
249
+
To demonstrate multiple scenarios, sample apps use the `#define` and `#if-#else/#elif-#endif` preprocessor directives to selectively compile and run different sections of sample code. For those samples that make use of this approach, set the `#define` directive at the top of the C# files to define the symbol associated with the scenario that you want to run. Some samples require defining the symbol at the top of multiple files in order to run a scenario.
250
+
251
+
For example, the following `#define` symbol list indicates that four scenarios are available (one scenario per symbol). The current sample configuration runs the `TemplateCode` scenario:
252
+
253
+
```csharp
254
+
#defineTemplateCode// or LogFromMain or ExpandDefault or FilterInCode
You may safely ignore or remove the `#region` and `#endregion` directives that surround the code. Don't alter the code within these directives if you plan to run the sample scenarios described in the topic.
288
+
289
+
For more information, see [Contribute to the ASP.NET documentation: Code snippets](https://github.com/dotnet/AspNetCore.Docs/blob/main/CONTRIBUTING.md#code-snippets).
Copy file name to clipboardExpand all lines: aspnetcore/fundamentals/index/includes/index3-7.md
+52Lines changed: 52 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -428,4 +428,56 @@ In Razor `.cshtml` files, tilde-slash (`~/`) points to the web root. A path begi
428
428
429
429
For more information, see <xref:fundamentals/static-files>.
430
430
431
+
## How to download a sample
432
+
433
+
Many of the articles and tutorials include links to sample code.
434
+
435
+
1.[Download the ASP.NET repository zip file](https://codeload.github.com/dotnet/AspNetCore.Docs/zip/main).
436
+
1. Unzip the `AspNetCore.Docs-main.zip` file.
437
+
1. To access an article's sample app in the unzipped repository, use the URL in the article's sample link to help you navigate to the sample's folder. Usually, an article's sample link appears at the top of the article with the link text *View or download sample code*.
438
+
439
+
### Preprocessor directives in sample code
440
+
441
+
To demonstrate multiple scenarios, sample apps use the `#define` and `#if-#else/#elif-#endif` preprocessor directives to selectively compile and run different sections of sample code. For those samples that make use of this approach, set the `#define` directive at the top of the C# files to define the symbol associated with the scenario that you want to run. Some samples require defining the symbol at the top of multiple files in order to run a scenario.
442
+
443
+
For example, the following `#define` symbol list indicates that four scenarios are available (one scenario per symbol). The current sample configuration runs the `TemplateCode` scenario:
444
+
445
+
```csharp
446
+
#defineTemplateCode// or LogFromMain or ExpandDefault or FilterInCode
You may safely ignore or remove the `#region` and `#endregion` directives that surround the code. Don't alter the code within these directives if you plan to run the sample scenarios described in the topic.
480
+
481
+
For more information, see [Contribute to the ASP.NET documentation: Code snippets](https://github.com/dotnet/AspNetCore.Docs/blob/main/CONTRIBUTING.md#code-snippets).
Copy file name to clipboardExpand all lines: aspnetcore/fundamentals/index/includes/index8.md
+53-1Lines changed: 53 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -211,8 +211,60 @@ In Razor `.cshtml` files, `~/` points to the web root. A path beginning with `~/
211
211
212
212
For more information, see <xref:fundamentals/static-files>.
213
213
214
+
## How to download a sample
215
+
216
+
Many of the articles and tutorials include links to sample code.
217
+
218
+
1.[Download the ASP.NET repository zip file](https://codeload.github.com/dotnet/AspNetCore.Docs/zip/main).
219
+
1. Unzip the `AspNetCore.Docs-main.zip` file.
220
+
1. To access an article's sample app in the unzipped repository, use the URL in the article's sample link to help you navigate to the sample's folder. Usually, an article's sample link appears at the top of the article with the link text *View or download sample code*.
221
+
222
+
### Preprocessor directives in sample code
223
+
224
+
To demonstrate multiple scenarios, sample apps use the `#define` and `#if-#else/#elif-#endif` preprocessor directives to selectively compile and run different sections of sample code. For those samples that make use of this approach, set the `#define` directive at the top of the C# files to define the symbol associated with the scenario that you want to run. Some samples require defining the symbol at the top of multiple files in order to run a scenario.
225
+
226
+
For example, the following `#define` symbol list indicates that four scenarios are available (one scenario per symbol). The current sample configuration runs the `TemplateCode` scenario:
227
+
228
+
```csharp
229
+
#defineTemplateCode// or LogFromMain or ExpandDefault or FilterInCode
You may safely ignore or remove the `#region` and `#endregion` directives that surround the code. Don't alter the code within these directives if you plan to run the sample scenarios described in the topic.
263
+
264
+
For more information, see [Contribute to the ASP.NET documentation: Code snippets](https://github.com/dotnet/AspNetCore.Docs/blob/main/CONTRIBUTING.md#code-snippets).
0 commit comments