hi every one,
i have an abstract class
public abstract class Document
{
public int DocumentID {get; set;}
}
and derived class
public class DoctorDocument : Document{
public string DoctorName {get;set;}
}
and I'm using Fluent Auto Mapping,
i need not to make a table for Document, but i need each derived class to get the DocumentID as Primary Key.
mappings.IgnoreBase<Document>();
mappings.AddEntityAssembly(typeof(DoctorDocument).Assembly);
mappings.Setup(c=>c.FindIdentity = type.Name == type.DeclaringType.Name + "ID";);
but it still can't find the ID and tells me that DoctorDocument doesn't have an ID. but when i made the following override it worked:
public class DoctorDocumentMap: IAutoMappingOverride<DoctorDocument>
{
public void Override(AutoMapping<DoctorDocument> mapping)
{
mapping.Id(x => x.Id, "DocumentID").GeneratedBy.Identity();
}
}
how can i tell the automapping to do that for all entities?? especially the GeneratedBy.Identity();