예제 #1
0
        // GET: Teacher/Details/5
        public async Task <ActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(BadRequest());//standard taalafhankelijk browser Http Error 400
            }
            var education = await _teacherRepo.GetForIdAsync(id.Value);

            if (education == null)
            {
                //return NotFound(); //Http Error 404
                //Of: Zorg voor een customised error (zie verder)
                Response.Redirect("/Error/404");
                return(View("Error", new ErrorViewModel {
                    RequestId = HttpContext.TraceIdentifier
                }));
            }
            return(View(education));
        }