dotnet / EntityFramework.Docs

Documentation for Entity Framework Core and Entity Framework 6
https://docs.microsoft.com/ef/
Creative Commons Attribution 4.0 International
1.6k stars 1.95k forks source link

Incorrect naming #2454

Open BuildItBusk opened 4 years ago

BuildItBusk commented 4 years ago

The private backing field is named "_url" but the configuration refers to "_validateUrl".

image

image


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ajcvickers commented 4 years ago

@BuildItBusk The example here is showing how to configure the backing field if it doesn't match the property name. It is not intended to refer to the exact same code sample as above. This seems clear from the DataAnnotation tab, but could be clearer in the fluent API tab.

BuildItBusk commented 4 years ago

@BuildItBusk The example here is showing how to configure the backing field if it doesn't match the property name. It is not intended to refer to the exact same code sample as above. This seems clear from the DataAnnotation tab, but could be clearer in the fluent API tab.

Fair enough. I just assumed that the backing field would match the property name. Either way, it's not a huge problem, as the key concept of the example is still very understandable :-)

ajcvickers commented 4 years ago

@BuildItBusk The point is that the backing field does not need to be specified if it the naming aligns with the property name. This example is showing how to specify the backing field when the field and the property are differently named.