Ejemplo n.º 1
0
        protected override void OnMapping(IMappingBuilder builder)
        {
            builder.Entity<Class>()
                   //.Table("SchoolClass")
                   .Key(_=>_.Id, "Class_id")
                   .Property(_=>_.Name, "ClassName")
                   ;

            builder.Entity<Student>()
                   .Key(_ => _.Id, "Student_id")
                 //.Property(_=>_.Name, "Name") not required
                   .Reference(_ => _.Class, "Class_id")
                   ;
        }
Ejemplo n.º 2
0
 protected override void OnMapping(IMappingBuilder builder)
 {
     builder.Entity<Student>();
     builder.Entity<Course>();
     builder.Entity<School>();
 }