Esempio n. 1
0
        public static MedicalReviewModel MapmedicalReviewModelFrom(MedicalReview medicalReview)
        {
            Mapper.CreateMap<MedicalReview, MedicalReviewModel>().ForMember(sp => sp.Specialty, so => so.Ignore());

            var medicalReviewModel = Mapper.Map<MedicalReview, MedicalReviewModel>(medicalReview);

            if (medicalReview.Specialty != null)
            {
                medicalReviewModel.Specialty = SpecialtyMapper.MapSpecialtyModelFrom(medicalReview.Specialty);
            }

            return medicalReviewModel;
        }
Esempio n. 2
0
        public virtual void CreateMedicalReview(int termMedicalReviewAt, Specialty specialty)
        {
            Assertion.GreaterThan(termMedicalReviewAt, 0, "Periodo não informado.").Validate();
            Assertion.NotNull(specialty, "Especialidade não informada").Validate();

            var medicalReview = new MedicalReview
            {
                TermMedicalReviewAt = termMedicalReviewAt,
                Specialty = specialty
            };

            MedicalReviews.Add(medicalReview);

            Assertion.IsTrue(MedicalReviews.Contains(medicalReview), "Revisão médica não inserida.").Validate();
        }