Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove outdated sample for field-only properties #1872

Merged
merged 1 commit into from
Oct 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions entity-framework/core/modeling/backing-field.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,8 @@ You can give EF the name of the field in the `Property(...)` API. If there is no

[!code-csharp[Main](../../../samples/core/Modeling/FluentAPI/BackingFieldNoProperty.cs#Sample)]

You can also choose to give the property a name, other than the field name. This name is then used when creating the model, most notably it will be used for the column name that is mapped to in the database.

[!code-csharp[Main](../../../samples/core/Modeling/FluentAPI/BackingFieldConceptualProperty.cs#Sample)]
AndriySvyryd marked this conversation as resolved.
Show resolved Hide resolved

When there is no property in the entity class, you can use the `EF.Property(...)` method in a LINQ query to refer to the property that is conceptually part of the model.

``` csharp
var blogs = db.blogs.OrderBy(b => EF.Property<string>(b, "Url"));
var blogs = db.blogs.OrderBy(b => EF.Property<string>(b, "_validatedUrl"));
```
42 changes: 0 additions & 42 deletions samples/core/Modeling/FluentAPI/BackingFieldConceptualProperty.cs

This file was deleted.