Fixing small issues. (typos/links/sample code) (#197)
* Fixed typo. Signed-off-by: mheyner <mheyner@gmail.com> * Correct sample code. Signed-off-by: mheyner <mheyner@gmail.com> * Fix typo's. Signed-off-by: Matthew Heyner <mheyner@gmail.com> * Fixed broken link
This commit is contained in:
Родитель
ebd1128cd6
Коммит
486fd86345
|
@ -3,7 +3,7 @@ by [Steve Smith](http://deviq.com/me/steve-smith)
|
|||
|
||||
## Who Should Read This
|
||||
|
||||
This tutorial is aimed at people who are learning ASP.NET Core for the first time. Familiarity with C# is assumed. If you're new to C#, you may wish to go through the [Getting Started with C#](../../../content/csharp/getting-started/intro.md) tutorial before beginning this one.
|
||||
This tutorial is aimed at people who are learning ASP.NET Core for the first time. Familiarity with C# is assumed. If you're new to C#, you may wish to go through the [Getting Started with C#](../../../content/csharp/getting-started/README.md) tutorial before beginning this one.
|
||||
|
||||
## Topics Covered
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ Then, add a class to represent the source of the quotations. Specify a few quote
|
|||
```c#
|
||||
public static class QuotationStore
|
||||
{
|
||||
public static IEnumerable<Quotation> Quotations {get; private set;}
|
||||
public static IList<Quotation> Quotations {get; private set;}
|
||||
|
||||
static QuotationStore()
|
||||
{
|
||||
|
|
|
@ -1,21 +1,22 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp1.0</TargetFramework>
|
||||
<PreserveCompilationContext>true</PreserveCompilationContext>
|
||||
<ProjectGuid>{70EAA845-7549-4CA0-BA02-973EFE6060FC}</ProjectGuid>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<WarningLevel>0</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="**\*.cs" Exclude="$(GlobalExclude)" />
|
||||
<EmbeddedResource Include="**\*.resx" Exclude="$(GlobalExclude)" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NETCore.App">
|
||||
<Version>1.0.1</Version>
|
||||
|
@ -66,6 +67,5 @@
|
|||
<Version>14.0.0</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
</Project>
|
|
@ -26,7 +26,7 @@ public void Configure(IApplicationBuilder app)
|
|||
### Note { .note }
|
||||
> Before you can use the ``UseStaticFiles`` extension, you must add the static files nuget package to the project: "Microsoft.AspNetCore.StaticFiles".
|
||||
|
||||
By default, browers will make requests for a *favicon.ico* file whenever an HTML request is made. This icon is displayed in the browser's tab or header view. By default the browser expects this file to be in the root of the web site. Having added support for static files to the quotations app, providing a valid favicon just requires adding a *wwwroot* folder to the root of the app, and placing an image file called *favicon.ico* in this folder. You can download a sample file [here](samples/quotes/wwwroot/favicon.ico).
|
||||
By default, browsers will make requests for a *favicon.ico* file whenever an HTML request is made. This icon is displayed in the browser's tab or header view. By default the browser expects this file to be in the root of the web site. Having added support for static files to the quotations app, providing a valid favicon just requires adding a *wwwroot* folder to the root of the app, and placing an image file called *favicon.ico* in this folder. You can download a sample file [here](samples/quotes/wwwroot/favicon.ico).
|
||||
|
||||
After adding the *wwwroot* folder and *favicon.ico* file, the app should run, but you may (depending on how you run the app) that the icon isn't being sent by the app when requested. If you run the app from the command line using ``dotnet run``, by default the *content root* of the app will be ``\bin\Debug\netcoreapp1.0\``, not the folder where your project files are located. To address this, update *Program.cs* to specify the current folder as content root:
|
||||
|
||||
|
@ -63,4 +63,4 @@ You can add other kinds of files to the *wwwroot* folder. The most common are HT
|
|||
|
||||
## Next Steps
|
||||
|
||||
Try adding a static HTML file to the *wwwroot* folder. You should be able to request it by name. Add support for default files and name your HTML file *defult.html*. Confirm that the file is served when you navigate to the root of your app.
|
||||
Try adding a static HTML file to the *wwwroot* folder. You should be able to request it by name. Add support for default files and name your HTML file *default.html*. Confirm that the file is served when you navigate to the root of your app.
|
||||
|
|
|
@ -160,7 +160,7 @@ Methods can accept parameters, which can be used to modify their behavior. Param
|
|||
> **Tip** {.tip .java}
|
||||
> The params array works the same way that *varargs* do in Java. Instead of `sum(int... list)`, just use `Sum(params int[] list)`.
|
||||
|
||||
The name of a method, combined with the types of its parameters, must be unique within the class to which the method belongs. This is known as as the method's *signature*. You will see an error when you build your program if you have two methods with the same name and set of parameter types, even if the return types are different or the parameers have different names. For example, having the following two methods within the same class would generate an error at compile time:
|
||||
The name of a method, combined with the types of its parameters, must be unique within the class to which the method belongs. This is known as as the method's *signature*. You will see an error when you build your program if you have two methods with the same name and set of parameter types, even if the return types are different or the parameters have different names. For example, having the following two methods within the same class would generate an error at compile time:
|
||||
|
||||
```{.snippet}
|
||||
string GetValue(string fileName)
|
||||
|
|
Загрузка…
Ссылка в новой задаче