public async Task UpdateAsync(int id, string name, int?parentId) { var directory = await _directoryRepository.GetAsync(id); directory.SetName(name); directory.SetParent(parentId); await _directoryRepository.UpdateAsync(directory); }