diff --git a/aspnet/fundamentals/configuration.rst b/aspnet/fundamentals/configuration.rst index 54e1553577..70d204de46 100644 --- a/aspnet/fundamentals/configuration.rst +++ b/aspnet/fundamentals/configuration.rst @@ -133,7 +133,7 @@ You configure options using the :dn:method:`~Microsoft.Extensions.DependencyInje :language: c# :lines: 26-42 :dedent: 8 - :emphasize-lines: 7-10,13 + :emphasize-lines: 7,10-13 When you bind options to configuration, each property in your options type is bound to a configuration key of the form ``property:subproperty:...``. For example, the ``MyOptions.Option1`` property is bound to the key ``Option1``, which is read from the ``option1`` property in *appsettings.json*. Note that configuration keys are case insensitive. diff --git a/aspnet/fundamentals/configuration/sample/src/UsingOptions/Startup.cs b/aspnet/fundamentals/configuration/sample/src/UsingOptions/Startup.cs index 15fd4157d0..834c39ba4e 100644 --- a/aspnet/fundamentals/configuration/sample/src/UsingOptions/Startup.cs +++ b/aspnet/fundamentals/configuration/sample/src/UsingOptions/Startup.cs @@ -28,15 +28,15 @@ namespace UsingOptions // Setup options with DI services.AddOptions(); + // Configure MyOptions using config by installing Microsoft.Extensions.Options.ConfigurationExtensions + services.Configure(Configuration); + // Configure MyOptions using code services.Configure(myOptions => { myOptions.Option1 = "value1_from_action"; }); - // Configure MyOptions using config by installing Microsoft.Extensions.Options.ConfigurationExtensions - services.Configure(Configuration); - // Add framework services. services.AddMvc(); } diff --git a/aspnet/fundamentals/error-handling.rst b/aspnet/fundamentals/error-handling.rst index d3d6bc6735..27263b53f8 100644 --- a/aspnet/fundamentals/error-handling.rst +++ b/aspnet/fundamentals/error-handling.rst @@ -74,7 +74,7 @@ By default, this middleware adds very simple, text-only handlers for common stat .. image:: error-handling/_static/default-404-status-code.png -The middleware supports several different extension methods. You can pass it a custom lamba expression: +The middleware supports several different extension methods. You can pass it a custom lamdba expression: .. code-block:: c# @@ -155,4 +155,4 @@ Handling Model State Errors :doc:`Model validation ` occurs prior to each controller action being invoked, and it is the action method’s responsibility to inspect ``ModelState.IsValid`` and react appropriately. In many cases, the appropriate reaction is to return some kind of error response, ideally detailing the reason why model validation failed. -Some apps will choose to follow a standard convention for dealing with model validation errors, in which case a :doc:`filter ` may be an appropriate place to implement such a policy. You should test how your actions behave with valid and invalid model states (learn more about :doc:`testing controller logic `). \ No newline at end of file +Some apps will choose to follow a standard convention for dealing with model validation errors, in which case a :doc:`filter ` may be an appropriate place to implement such a policy. You should test how your actions behave with valid and invalid model states (learn more about :doc:`testing controller logic `). diff --git a/aspnet/fundamentals/startup.rst b/aspnet/fundamentals/startup.rst index 9ecdcb8473..2a9c8c4b22 100644 --- a/aspnet/fundamentals/startup.rst +++ b/aspnet/fundamentals/startup.rst @@ -1,3 +1,5 @@ +:version: 1.0.0-rc1 + .. _application-startup: Application Startup diff --git a/aspnet/security/authentication/cookie.rst b/aspnet/security/authentication/cookie.rst index bf4bcf9695..cc3fa9281c 100644 --- a/aspnet/security/authentication/cookie.rst +++ b/aspnet/security/authentication/cookie.rst @@ -10,7 +10,7 @@ ASP.NET Core provides cookie :ref:`middleware ` which s Adding and configuring ---------------------- -The first step is adding the cookie middleware to your application. First use nuget to add the ``Microsoft.AspNetCore.Authentication.Cookies`` package. Then add the following lines to the ``Configure`` method in your *Startup.cs* file; +The first step is adding the cookie middleware to your application. First use nuget to add the ``Microsoft.AspNetCore.Authentication.Cookies`` package. Then add the following lines to the ``Configure`` method in your *Startup.cs* file before the ``app.UseMvc()`` statement; .. code-block:: c#