title: SignalR and sql dependency only on insert
body: <p>I use signalR and SQL Dependency for real time notification in asp.net mvc 5.2
  I implement <code>SignalR</code> from this link </p>
  
  <pre><code>http://venkatbaggu.com/signalr-database-update-notifications-asp-net-mvc-usiing-sql-dependency/
  </code></pre>
  
  <p>no I have one problem , in this scenario on any change on table , SQL dependency run and return record,I want just on insert in table SQL dependency fired and return record,</p>
  
  <p>because in this table I update a bit filed for read notification on user read notification in panel, when I update the filed SQL dependency fired,</p>
  
  <p>how I can defined SQL dependency just for insert in table?</p>
  
  <p>thank you for your help</p>
  
  <p>i use this code</p>
  
  <pre><code> public IEnumerable&lt;Messages&gt; GetAllMessages()
          {
              var messages = new List&lt;Messages&gt;();
              using (var connection = new SqlConnection(_connString))
              {
                  connection.Open();
                  using (var command = new SqlCommand(@"SELECT [Id],[Player_Id], [Message] FROM [dbo].[Notification] WHERE [Player_Id] = " + PlayerLogin.userId + " AND PlayerIsRed = 0", connection))
                  {
                      command.Notification = null;
  
                      var dependency = new SqlDependency(command);
                      dependency.OnChange += new OnChangeEventHandler(dependency_OnChange);
  
                      if (connection.State == ConnectionState.Closed)
                          connection.Open();
  
                      var reader = command.ExecuteReader();
  
                      while (reader.Read())
                      {
                          messages.Add(item: new Messages { Id = (int)reader["Id"], Message = (string)reader["Message"], Player_Id = (int)reader["Player_Id"] });
                      }
                  }
  
              }
              return messages;
          }
  </code></pre>