public async Task HandleAsync(CreatePhoneBookCommand command) { var phoneBook = await _phoneBookRepository.GetPhoneBookByNameAsync(command.Name); if (phoneBook != null) { throw new ValidateException("Phone book already exists"); } await _phoneBookRepository.AddAsync(new Entities.PhoneBookAggregateRoot(command.Name)); await _phoneBookRepository.SaveAsync(); }