Ejemplo n.º 1
0
        public Teacher Createteacher(AddTeacherDTO teachDTO)
        {
            var teacher = Mapper.Map <AddTeacherDTO, Teacher>(teachDTO);

            repo.Add(teacher);

            return(teacher);
        }
Ejemplo n.º 2
0
 public IHttpActionResult AddTeacher(AddTeacherDTO teach)
 {
     if (ModelState.IsValid)
     {
         var Createdteacher = teacher.Createteacher(teach);
         return(Ok(Createdteacher));
     }
     else
     {
         return(BadRequest("Data is not valid"));
     }
 }