Beispiel #1
0
        private void _sqlDependency_OnChange(object sender, SqlNotificationEventArgs e)
        {
            if (_context == null)
            {
                return;
            }

            if (e.Type == SqlNotificationType.Subscribe || e.Info == SqlNotificationInfo.Error)
            {
                var args = new NotifierErrorEventArgs
                {
                    Reason = e,
                    Sql    = GetCurrent().ToString()
                };

                OnError(args);
            }
            else
            {
                var args = new EntityChangeEventArgs <TEntity>
                {
                    Results           = GetCurrent(),
                    ContinueListening = true
                };

                OnChanged(args);

                if (args.ContinueListening)
                {
                    RegisterNotification();
                }
            }
        }
Beispiel #2
0
 protected virtual void OnError(NotifierErrorEventArgs e)
 {
     if (Error != null)
     {
         Error(this, e);
     }
 }
Beispiel #3
0
 void _changeNotifier_Error(object sender, NotifierErrorEventArgs e)
 {
     base.OnChanged(null);
 }