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(); } } }
protected virtual void OnChanged(EntityChangeEventArgs <TEntity> e) { if (Changed != null) { Changed(this, e); } }
void _changeNotifier_Changed(object sender, EntityChangeEventArgs <TEntity> e) { base.OnChanged(e.Results); }