예제 #1
0
        public async Task <ActionResult <LecturerViewModel> > GetLecturer(int id)
        {
            var lecturers = _lecturerService.GetById(id);

            if (lecturers == null)
            {
                return(NotFound("Không tìm thấy id = " + id));
            }

            return(await Task.FromResult(lecturers));
        }
예제 #2
0
 /// <summary>
 /// 编辑
 /// </summary>
 /// <param name="_LecturerVM"></param>
 /// <returns></returns>
 public ActionResult Edit(LecturerVM _LecturerVM)
 {
     _LecturerVM.Lecturer = _LecturerService.GetById(_LecturerVM.Id) ?? new Lecturer();
     _LecturerVM.ImgInfo  = _imageInfoService.GetById(_LecturerVM.Lecturer.ImageInfoId) ?? new ImageInfo();
     return(View(_LecturerVM));
 }