I need to derive two of my Entity classes from a base class that does not belong to the model.
[NotMapped]
public abstract class BaseClass
{
[NotMapped]
public string SomeProperty { get; set; }
}
public partial class Derived1: BaseClass {}
public partial class Derived2: BaseClass {}
I have tried marking the base class and all its properties as [NotMapped]
but the context initializer throw an error saying that both my derived entity classes are not mapped.
Figured it out. The [NotMapped] attribute should not have been applied to the base class, but only its properties.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With