public Teacher Createteacher(AddTeacherDTO teachDTO) { var teacher = Mapper.Map <AddTeacherDTO, Teacher>(teachDTO); repo.Add(teacher); return(teacher); }
public IHttpActionResult AddTeacher(AddTeacherDTO teach) { if (ModelState.IsValid) { var Createdteacher = teacher.Createteacher(teach); return(Ok(Createdteacher)); } else { return(BadRequest("Data is not valid")); } }