title: Continue listening for SQLDependency
body: <p>I have a Windows Form application that use a Notifier for capture SQLDependency change event with Entity Framework and all works fine. The EntityChangeNotifier is a project that elaborate the SQLDependency. </p>
  
  <p>Whit the call <code>while (true)</code> i can have a continue listening and when i have a change the code enter in <code>notifer.Changed += (sender, e)</code></p>
  
  <pre><code>        private StartNotifier()
          {
              var info = new SABIntegrationEntities();
              // Notifier
              using (var notifer = new EntityChangeNotifier&lt;SpRicezioneSpedizioniLightNotifier, GemapDbContext&gt;(p =&gt; p.SPEDIZIONE_STATO_GENERAZIONE == "I" || p.SPEDIZIONE_STATO_GENERAZIONE == "U"))
              {
                  notifer.Error += (sender, e) =&gt;
                  {
                      Log.Error(String.Format("[{0}, {1}, {2}]:\n{3}", e.Reason.Info, e.Reason.Source, e.Reason.Type, e.Sql));
                  };
                  notifer.Changed += (sender, e) =&gt;
                  {
                      e.ContinueListening = false;
                      bool result = true;
                      var spedizioniI = info.SpRicezioneSpedizioniLights.Where(x =&gt; x.SPEDIZIONE_STATO_GENERAZIONE == "I" || x.SPEDIZIONE_STATO_GENERAZIONE == "U");
                      foreach (var p in spedizioniI)
                          {
                              p.SPEDIZIONE_STATO_GENERAZIONE = "G";
                          }
                      }
                      e.ContinueListening = true;
                  };
                  while (true)
                  {
                  }
             }
         }
  </code></pre>
  
  <p>I want to have a continue listening in this code better than While(true). How can i do it?</p>
  
  <p>If you want you can find the complete project structure here: <a href="https://stackoverflow.com/questions/36543328/invalid-statement-subscribe-in-sqldependency">enter link description here</a></p>
  
  <p>Thank to all</p>