From ec3900547a66b4b8241e66a152a9909847f60be5 Mon Sep 17 00:00:00 2001 From: Rick Anderson Date: Wed, 6 Jul 2016 11:35:14 -0600 Subject: [PATCH 1/4] Update startup.rst (#1624) --- aspnet/fundamentals/startup.rst | 2 ++ 1 file changed, 2 insertions(+) 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 From 1955e4609d37719672e5847de4b886aa9d626d39 Mon Sep 17 00:00:00 2001 From: Thiago Majesk Goulart Date: Wed, 6 Jul 2016 14:37:48 -0300 Subject: [PATCH 2/4] Update cookie.rst (#1621) Added explicity description to show that the authentication middleware configuration should be done before Mvc. Avoiding trouble for new users that don't fully understand how the configuration flow works. --- aspnet/security/authentication/cookie.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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# From 555025711af70b54abea6b3e666498911f53f2f7 Mon Sep 17 00:00:00 2001 From: Zou Jian Date: Thu, 7 Jul 2016 01:38:32 +0800 Subject: [PATCH 3/4] Typos lamba expression=> lamdba expression (#1629) --- aspnet/fundamentals/error-handling.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 `). From 8f2e51fd35838e67e7a23201dd4a87e1134c148c Mon Sep 17 00:00:00 2001 From: Zeke Lu Date: Thu, 7 Jul 2016 02:15:56 +0800 Subject: [PATCH 4/4] fix the issue that the code doesn't do as stated in the doc (#1616) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The doc states that: the value of Option1 is overridden by the configured delegate with the value “value1_from_action” In order to make this statement true, the configurd delegate should be put last. This issue is introducted by PR #1331 --- aspnet/fundamentals/configuration.rst | 2 +- .../configuration/sample/src/UsingOptions/Startup.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) 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(); }