我有以下业务对象:
public class CreatedCompositeEntity : Entity, IEntity, IModified, ICreated, IIsActive
{
public CreatedCompositeEntity()
{
IsActive = true;
}
[Required, Key]
[Column(Order = 0)]
[DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
public DateTime CreatedOn { get; set; }
[Key]
[Column(Order = 1)]
[DatabaseGeneratedAttribute(DatabaseGeneratedOption.None)]
public int CreatedBy { get; set; }
public Nullable<DateTime> ModifiedOn { get; set; }
public Nullable<int> ModifiedBy { get; set; }
public bool IsActive { get; set; }
}
public class HeadCollectionTypeBO : CreatedCompositeEntity
{
public HeadCollectionTypeBO()
{
IsActive = true;
}
public string CollectionType { get; set; }
}
public class HeadBO : CreatedCompositeEntity
{
public HeadBO()
{
IsActive = true;
}
public string HeadName { get; set; }
public int VenueId { get; set; }
public virtual VenueBO Venue { get; set; }
public int CollectionTypeId { get; set; }
public virtual HeadCollectionTypeBO CollectionType { get; set; }
}
执行迁移后,(m_head)HeadBO中添加了额外的列作为CollectionType_Id和CollectionType_CreatedBy。我是Entity Framework的新手。请建议我解决。