This project has moved. For the latest updates, please go here.
1
Vote

NotMapped Attribute being ignored on inheriting class

description

If I have a context like such
public partial class HTTransDB : DbContext  
{

    public HTTransDB()
        : base("name=HTTransDB")
    {

    }

    public virtual DbSet<ImportError> ImportError{ get; set; }
}
and my entity:
public partial class ImportError
{
    // Properties... 
}
and then extend it:
[NotMapped]
public class SpecialImportError : ImportError
{
     // some other property
}

Then bulk insert ImportError (Not SpecialImportError) I will get a Mapping Exception.
// Throws exception
db.BulkInsert(importErrors);

// Works but slow
db.ImportErrors.AddRange(importErrors);
I'm using:
.Net 4.5.1
EF 6.1.3
BulkInsert-ef6 v 6.0.2.8
MappingAPI: 6.1.0.9

comments