I have a base class BaseFunction
:
public class BaseFunction { [Key] public int BaseFunctionID { get; set; } public string Name { get; set; } }
I also have a derived class 'ObjectiveFunction`:
public class ObjectiveFunction : BaseFunction { public bool IsMax { get; set; } }
When I try to build a migration, I get the error: "The entity type 'ObjectiveFunction' requires a primary key to be defined.
I was under the assumption the primary key would be defined by the base class ObjectiveFunction
extends. Am I misunderstanding how to set this up or do I have something else going on (un-synced migrations, for example?)
没有评论:
发表评论