Model:
Entity class as the Id is shared between all entities
public abstract class Entity
{
public int Id { get; set; }
}
And the Student class, which inherits the Entity class
public class Student : Entity
{
public string LastName { get; set; }
public string Forenames { get; set; }
public DateTime EnrolmentDate { get; set; }
public virtual ICollection<Enrolment> Enrolments { get; set; }
}
Table columns have the naming convention STUDENT_ID, LAST_NAME, FORENAMES etc. All tables will have the ID column of [NAME]_ID
How do I create a custom mapping for all properties in all entity classes? The code referenced here does not work as the .Entities()
method does not exist any more.