public IActionResult Details(int id) { var Course = _courseData.GetCourseById(id); var model = new CourseDetailsModel(); model.Course = _courseData.GetCourseById(id); model.AutorName = _autorData.GetAutorById(model.Course.idAutor).Name; if (model == null) { return(RedirectToAction(nameof(Index))); } return(View(model)); }
public void PrintById(int id) { var course = courseDatabase.GetCourseById(id); System.Console.WriteLine(course); }
public void PrintById(int id) { var course = data.GetCourseById(id); // print course }
public void PrintById(ICourseData data, int id) { var courses = data.GetCourseById(id); // print courses }