Creating a non mapped property in an entity (entity framework)

You can also mark your property with [NotMapped] attribute or use Ignore method from fluent API.

Property

public class EntityName
{
    [NotMapped]
    private string PropertyName { get; }
}

Fluent API

 public class Entities : DbContext
 {
    public DbSet<EntityType> Users { get; set; }
    protected override void OnModelCreating(DbModelBuilder modelBuilder)
    {
       // Some database configuration
       modelBuilder.Entity<EntityType>()
             .Ignore(i => i.PropertyName);
     }
 }

Leave a Comment

deneme bonusudeneme bonusu veren sitelerOnwin Güncel Giriştürkçe altyazılı pornocanlı bahis casino