Exemplo n.º 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));
        }
Exemplo n.º 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));
        }