public async Task <IActionResult> CreateDirector([FromBody] DirectorForUpdateDTO directorDto)
        {
            try
            {
                var director = _mapper.Map <Director>(directorDto);

                var directorFromRepo = await _repository.Add(director);

                if (directorFromRepo != null)
                {
                    return(CreatedAtAction(nameof(GetDirectorById), new { id = director.Id }, director));
                }
                return(BadRequest("Failed to create director."));
            }
            catch (Exception e)
            {
                var result = new { Status = StatusCodes.Status500InternalServerError, Data = $"Failed to update the director. Exception thrown when attempting to update data in the database: {e.Message}" };
                return(this.StatusCode(StatusCodes.Status500InternalServerError, result));
            }
        }
        public async Task <IActionResult> UpdateDirectorDetails(int id, [FromBody] DirectorForUpdateDTO directorForUpdateDto)
        {
            try
            {
                var directorFromRepo = await _repository.Get <Director>(id);

                if (directorFromRepo == null)
                {
                    return(BadRequest($"Could not update director. Director with Id {id} was not found."));
                }
                var directorForUpdate = _mapper.Map(directorForUpdateDto, directorFromRepo);

                await _repository.Update(directorForUpdate);

                return(NoContent());
            }
            catch (Exception e)
            {
                var result = new { Status = StatusCodes.Status500InternalServerError, Data = $"Failed to update the director. Exception thrown when attempting to update data in the database: {e.Message}" };
                return(this.StatusCode(StatusCodes.Status500InternalServerError, result));
            }
        }