Exemplo n.º 1
0
 public void UpdateAppointment(AppointmentData entity)
 {
     if (entity == null)
     {
         throw new ArgumentNullException(nameof(entity));
     }
     DataContext.SaveChanges();
 }
Exemplo n.º 2
0
        public AppointmentData CreateAppointment(AppointmentData entity)
        {
            if (entity == null)
            {
                throw new ArgumentNullException(nameof(entity));
            }
            var i = DataContext.Appointments.Add(entity);

            DataContext.SaveChanges();
            return(i);
        }
Exemplo n.º 3
0
 public void DeleteAppointment(AppointmentData entity)
 {
     if (entity == null)
     {
         throw new ArgumentNullException(nameof(entity));
     }
     foreach (var e in entity.Cancellations.ToList())
     {
         DataContext.Appointments.Remove(e);
     }
     DataContext.Appointments.Remove(entity);
     DataContext.SaveChanges();
 }