public RegistrationInPharmacy Create(RegistrationInPharmacyDto dto) { RegistrationInPharmacy registration = RegistrationInPharmacyAdapter.RegistrationDtoToRegistration(dto); if (isApiKeyUnique(registration.ApiKey)) { return(RegistrationInPharmacyRepository.Create(registration)); } return(null); }
public RegistrationInPharmacy createIRegistration(RegistrationInPharmacyDto dto) { foreach (RegistrationInPharmacy registrationIRepo in IRegistrationRepository.GetAll()) { if (registrationIRepo.ApiKey.Equals(RegistrationInPharmacyAdapter.RegistrationDtoToRegistration(dto).ApiKey)) { return(null); } } return(RegistrationInPharmacyAdapter.RegistrationDtoToRegistration(dto)); }