public async Task <IActionResult> Create(LessonDto lessonDto) { if (await _lessonService.AreThereLesson(lessonDto.LessonName.ToLower(), lessonDto.FkGradeId) == false) { await _lessonService.AddAsync(_mapper.Map <Lesson>(lessonDto)); ViewBag.ErrorMessage = ""; return(RedirectToAction("GetAll", "Lesson")); } ViewBag.ErrorMessage = "Sistemde aynı isme ait ders bulunmaktadır...!"; return(View(lessonDto)); }