public static TaskDefinitionForCreationDto GetTaskDefinitionForCreationDto(string title,
                                                                                   int hours, int minutes, int seconds)
        {
            var dto = new TaskDefinitionForCreationDto()
            {
                Title   = title,
                Hours   = hours,
                Minutes = minutes,
                Seconds = seconds
            };

            return(dto);
        }
        public async Task <IActionResult> CreateTaskDefinition(TaskDefinitionForCreationDto taskDefinitionForCreation)
        {
            var taskDefinitionEntity = mapper.Map <TaskDefinition>(taskDefinitionForCreation);

            timedTodoRepository.AddTaskDefinition(taskDefinitionEntity);

            await timedTodoRepository.SaveChangesAsync();

            return(CreatedAtRoute(
                       "GetTaskDefinition",
                       new { id = taskDefinitionEntity.Id },
                       taskDefinitionEntity));
        }