Skip to content

Commit

Permalink
Remove outdated sample for field-only properties
Browse files Browse the repository at this point in the history
Fixes #1257
  • Loading branch information
AndriySvyryd committed Oct 22, 2019
1 parent b8d64da commit f0a2852
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 47 deletions.
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)]

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.

0 comments on commit f0a2852

Please sign in to comment.