public Consultation Update(Consultation Consultation)
 {
     DbEntityEntry entry = context.Entry(Consultation);
     entry.State = EntityState.Modified;
     context.SaveChanges();
     return Consultation;
 }
        public void CreateAInvalidConsultationAgeTest()
        {
            Consultation Consultation = new Consultation();
            Consultation.Name = "Raul";

            Validator.Validate(Consultation);
        }
        public void CreateAInvalidConsultationCpfTest()
        {
            Consultation Consultation = new Consultation();
            Consultation.Name = "SI Uniplac";
            Consultation.Age = 20;

            Validator.Validate(Consultation);
        }
Пример #4
0
        public Consultation Update(Consultation consultation)
        {
            Validator.Validate(consultation);

            var updatedConsultation = _consultationRepository.Update(consultation);

            return updatedConsultation;
        }
Пример #5
0
        public Consultation Create(Consultation consultation)
        {
            Validator.Validate(consultation);

            var savedConsultation = _consultationRepository.Save(consultation);

            return savedConsultation;
        }
        public void CreateAInvalidConsultationRgTest()
        {
            Consultation Consultation = new Consultation();
            Consultation.Name = "SI Uniplac";
            Consultation.Age = 20;
            Consultation.Cpf = "090.319-189-03";

            Validator.Validate(Consultation);
        }
        public void CreateAInvalidConsultationDateTest()
        {
            Consultation Consultation = new Consultation();
            Consultation.Name = "SI Uniplac";
            Consultation.Age = 20;
            Consultation.Cpf = "090.319-189-03";
            Consultation.Rg = "6.301.210";
            Consultation.Type = "LOL";

            Validator.Validate(Consultation);
        }
Пример #8
0
        public static Consultation GetConsultation()
        {
            Consultation consultation = new Consultation();
            consultation.Name = "Raul";
            consultation.Age = 20;
            consultation.Cpf = "090.319.189-03";
            consultation.Rg = "6.301.210";
            consultation.Type = "Verificação Anual";
            consultation.Date = DateTime.Now;

            return consultation;
        }
 public Consultation Save(Consultation xonsultation)
 {
     var newConsultation = context.Consultations.Add(xonsultation);
     context.SaveChanges();
     return newConsultation;
 }
Пример #10
0
        public void CreateAInvalidConsultationNameTest()
        {
            Consultation consultation = new Consultation();

            Validator.Validate(consultation);
        }