Beispiel #1
0
        public ActionResult <UpdateTeacherResponse> Update([FromBody] TeacherRequestData requestData)
        {
            UpdateTeacherRequest  request  = new UpdateTeacherRequest(requestData);
            UpdateTeacherResponse response = this._updateTeacher.Process(request);

            if (response.Success == false)
            {
                return(BadRequest(response));
            }

            return(Ok(response));
        }
Beispiel #2
0
        public Teacher BuildFrom(TeacherRequestData requestData)
        {
            if (requestData == null)
            {
                return(null);
            }

            return(new Teacher
            {
                TeacherId = requestData.TeacherId,
                Name = requestData.Name,
                Gender = requestData.Gender.Value,
                LevelId = requestData.Level.Value,
                Salary = requestData.Salary.Value,
                AdmitionDate = requestData.AdmitionDate.Value
            });
        }
Beispiel #3
0
 public UpdateTeacherRequest(TeacherRequestData requestData)
 {
     Data = requestData;
 }