public async Task <int> CreateAsync(ToDoDto toDoDto) { ToDoDbModel toDo = toDoEntityConverter.Convert(toDoDto); await dbContext.AddAsync(toDo); await dbContext.SaveChangesAsync(); return(toDo.Id); }
public ToDoDto Convert(ToDoDbModel source) { return(source != null ? new ToDoDto { Id = source.Id, Description = source.Description, IsCompleted = source.IsCompleted } : null); }