public static Allergy DTOtoAllergy(AllergyDTO allergyDTO)
 {
     return(new Allergy
     {
         Name = allergyDTO.Name
     });
 }
 public static AllergyViewModel DTOtoAllergyVM(AllergyDTO allergyDTO)
 {
     return(new AllergyViewModel
     {
         Id = allergyDTO.Id,
         Name = allergyDTO.Name
     });
 }
Exemplo n.º 3
0
        public void Create(AllergyDTO allergyDTO)
        {
            var medicalChart = _context.MedicalCharts.SingleOrDefault(mc => mc.Id.Equals(allergyDTO.MedicalChartId));
            var allergy      = AllergyMapper.DTOtoAllergy(allergyDTO);

            allergy.MedicalChart = medicalChart;
            _context.Allergies.Add(allergy);
            _context.SaveChanges();
        }
Exemplo n.º 4
0
 public static Allergy ConvertAllergyToDAL(AllergyDTO allergy)
 {
     return(new Allergy
     {
         AllergyCode = allergy.AllergyCode,
         AllergyName = allergy.AllergyName,
         IsPersonal = allergy.IsPersonal
     });
 }