public ActionResult Put(Guid id, [FromBody] TeacherRequest request)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            try
            {
                var teacher = teacherRepository.Get(id);
                if (teacher != null)
                {
                    teacher.FirstName  = request.FirstName;
                    teacher.MiddleName = request.MiddleName;
                    teacher.LastName   = request.LastName;
                    teacher.BirthDate  = request.BirthDate;
                    teacher.Gender     = Gender.FromId(request.Gender) ?? Gender.NotSpecified;
                    teacher.Title      = NameTitle.FromId(request.Title) ?? NameTitle.None;

                    this.teacherRepository.Update(teacher);

                    return(Ok());

                    //TODO: Add audit info in response
                    //var response = new UpdateTeacherResponse(teacher.Id);
                    //return Ok(response);
                }

                return(NotFound());
            }
            catch (Exception e)
            {
                return(GenericServerErrorResult(e));
            }
        }
        public ActionResult <NewRecordResponse> Post([FromBody] TeacherRequest request)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            try
            {
                var teacher = new Teacher
                {
                    FirstName  = request.FirstName,
                    MiddleName = request.MiddleName,
                    LastName   = request.LastName,
                    BirthDate  = request.BirthDate,
                    Gender     = Gender.FromId(request.Gender) ?? Gender.NotSpecified,
                    Title      = NameTitle.FromId(request.Title) ?? NameTitle.None
                };

                this.teacherRepository.Create(teacher);

                var response = new NewRecordResponse(teacher.Id);

                return(CreatedAtAction(nameof(Get), new { id = teacher.Id }, response));
            }
            catch (Exception e)
            {
                return(GenericServerErrorResult(e));
            }
        }