예제 #1
0
 public static MedicineDescription MedicineDescriptionDtoToMedicineDescription(MedicineDescriptionDto dto)
 {
     return(new MedicineDescription(dto.Name, dto.Description, dto.MedicineDescriptionId));
 }
        public MedicineDescription createIMedicineDescription(MedicineDescriptionDto dto)
        {
            MedicineDescription medicineDescription = IMedicineDescriptionRepository.GetAll().SingleOrDefault(medicineDescriptionIt => CheckMedicineNameEquality(dto, medicineDescriptionIt));

            return(medicineDescription == null ? MedicineDescriptionAdapter.MedicineDescriptionDtoToMedicineDescription(dto) : null);
        }
 private static bool CheckMedicineNameEquality(MedicineDescriptionDto dto, MedicineDescription medicineDescription)
 {
     return(medicineDescription.Name.Equals(MedicineDescriptionAdapter.MedicineDescriptionDtoToMedicineDescription(dto).Name));
 }
 public MedicineDescription Create(MedicineDescriptionDto dto)
 {
     return(MedicineDescriptionRepository.Create(MedicineDescriptionAdapter.MedicineDescriptionDtoToMedicineDescription(dto)));
 }