Skip to content

Commit 3d44f39

Browse files
analogrelayguardrex
authored andcommitted
Updates to clarify that fields are not bound in config (dotnet#16687)
1 parent 781f37c commit 3d44f39

File tree

1 file changed

+3
-3
lines changed
  • aspnetcore/fundamentals/configuration

1 file changed

+3
-3
lines changed

aspnetcore/fundamentals/configuration/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn how to use the Configuration API to configure an ASP.NET Core
55
monikerRange: '>= aspnetcore-2.1'
66
ms.author: riande
77
ms.custom: mvc
8-
ms.date: 01/13/2020
8+
ms.date: 01/23/2020
99
uid: fundamentals/configuration/index
1010
---
1111
# Configuration in ASP.NET Core
@@ -917,7 +917,7 @@ Given the example data, `sectionExists` is `false` because there isn't a `sectio
917917

918918
Configuration can be bound to classes that represent groups of related settings using the *options pattern*. For more information, see <xref:fundamentals/configuration/options>.
919919

920-
Configuration values are returned as strings, but calling <xref:Microsoft.Extensions.Configuration.ConfigurationBinder.Bind*> enables the construction of [POCO](https://wikipedia.org/wiki/Plain_Old_CLR_Object) objects.
920+
Configuration values are returned as strings, but calling <xref:Microsoft.Extensions.Configuration.ConfigurationBinder.Bind*> enables the construction of [POCO](https://wikipedia.org/wiki/Plain_Old_CLR_Object) objects. The binder binds values to all of the public read/write properties of the type provided. Fields are **not** bound.
921921

922922
The sample app contains a `Starship` model (*Models/Starship.cs*):
923923

@@ -974,7 +974,7 @@ The sample app calls `GetSection` with the `starship` key. The `starship` key-va
974974

975975
## Bind to an object graph
976976

977-
<xref:Microsoft.Extensions.Configuration.ConfigurationBinder.Bind*> is capable of binding an entire POCO object graph.
977+
<xref:Microsoft.Extensions.Configuration.ConfigurationBinder.Bind*> is capable of binding an entire POCO object graph. As with binding a simple object, only public read/write properties are bound.
978978

979979
The sample contains a `TvShow` model whose object graph includes `Metadata` and `Actors` classes (*Models/TvShow.cs*):
980980

0 commit comments

Comments
 (0)