/// <summary>
        /// Delete a standard appointment and all the exceptions that links to it.
        /// </summary>
        /// <param name="request"></param>
        public virtual void Any(DeleteStandardAppointment request)
        {
            var _repository = _DataRepositoryFactory.GetDataRepository <IGenericEntityRepositoryBase <StandardAppointment, IDataContextNhJars> >();

            _repository.Delete(request.Id);
            TrySendDeleteNotificationToChannel(typeof(StandardAppointment).Name, new[] { request.Id.ToString() });
        }
        public void OnAppointmentsDeleted(object sender, Appointment appointment)
        {
            if (appointment.IsBase)
            {
                StandardAppointment stdAppointment = appointment.CustomFields["ENTITY"] as StandardAppointment;

                DeleteStandardAppointment delete = new DeleteStandardAppointment()
                {
                    IsAppointment = true,
                    Id            = stdAppointment.Id
                };
                Context.ServiceClient.Delete(delete);
            }
            else
            {
                if (new[] { AppointmentType.DeletedOccurrence, AppointmentType.Occurrence }.Contains(appointment.Type))
                {
                    //need to create an exception here.
                    appointment.CreateException(AppointmentType.DeletedOccurrence, appointment.RecurrenceIndex);
                }
            }
        }