public ICommandResult Handler(CreateSpecialtyCommand command) { Specialty specialty = new Specialty(command.Name); if (!specialty.IsValid()) { return(null); } _specialtyRepository.Save(specialty); return(new StandardSpecialtyCommandResult(specialty.Id, DateTime.Now)); }
public async Task CreateSpecialty(Specialty specialty) { _specialtyRepository.AddSpecialty(specialty); await _specialtyRepository.Save(); }