diff --git a/entity-framework/core/modeling/backing-field.md b/entity-framework/core/modeling/backing-field.md index 149eaeb9e2..898a1e4df1 100644 --- a/entity-framework/core/modeling/backing-field.md +++ b/entity-framework/core/modeling/backing-field.md @@ -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(b, "Url")); +var blogs = db.blogs.OrderBy(b => EF.Property(b, "_validatedUrl")); ``` diff --git a/samples/core/Modeling/FluentAPI/BackingFieldConceptualProperty.cs b/samples/core/Modeling/FluentAPI/BackingFieldConceptualProperty.cs deleted file mode 100644 index a68bbb35d7..0000000000 --- a/samples/core/Modeling/FluentAPI/BackingFieldConceptualProperty.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using System.Net.Http; - -namespace EFModeling.FluentAPI.BackingFieldConceptualProperty -{ - class MyContext : DbContext - { - public DbSet Blogs { get; set; } - - #region Sample - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - modelBuilder.Entity() - .Property("Url") - .HasField("_validatedUrl"); - } - #endregion - } - - public class Blog - { - private string _validatedUrl; - - public int BlogId { get; set; } - - public string GetUrl() - { - return _validatedUrl; - } - - public void SetUrl(string url) - { - using (var client = new HttpClient()) - { - var response = client.GetAsync(url).Result; - response.EnsureSuccessStatusCode(); - } - - _validatedUrl = url; - } - } -}