Пример #1
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Student = await _context.Student.FirstOrDefaultAsync(m => m.ID == id);

            if (null == Student)
            {
                return(NotFound());
            }
            StudentVM = new StudentVM();
            StudentVM.CopyPropertiesFrom(Student);
            //StudentVM.FirstMidName = Student.FirstMidName;
            //StudentVM.LastName = Student.LastName;
            //StudentVM.ID = Student.ID;
            //StudentVM.EnrollmentDate = Student.EnrollmentDate;
            //StudentVM = await _context.StudentVM.FirstOrDefaultAsync(m => m.ID == id);

            //if (StudentVM == null)
            //{
            //    return NotFound();
            //}
            return(Page());
        }
Пример #2
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Student = await _context.Student.FirstOrDefaultAsync(m => m.ID == id);

            if (null != Student)
            {
                StudentVM = new StudentVM();
                StudentVM.CopyPropertiesFrom(Student);
            }
            //StudentVM = await _context.StudentVM.FirstOrDefaultAsync(m => m.ID == id);

            if (StudentVM == null)
            {
                return(NotFound());
            }
            return(Page());
        }