Beispiel #1
0
        public bool Insert(Student student, string MajorCode)
        {
            var majorCtrl = new MajorsController(this.Connection);
            var major     = majorCtrl.GetByCode(MajorCode);

            student.MajorId = major?.Id;
            return(Insert(student));
        }
Beispiel #2
0
        public bool Insert(Student student, string MajorCode)
        {
            var majorCtrl = new MajorsController(this.Connection);
            //this.connection is for using the already initialized connection
            var major = majorCtrl.GetByCode(MajorCode);

            student.MajorId = major?.Id; /* <--if major is null, add it as major id?*/
            return(Insert(student));
        }