title: Use the foreach for properties of class
body: <p>I'm writing an function to update a row in table (SQLite). At one time I only need to update certain columns of that row.</p>
  
  <p>My Video class (and table) has these properties (and columns):
    Id, Name, Lyric, Cover,Gendre, Url. ( they're all string)</p>
  
  <p>Now, for example, I need to update the lyric and cover of 1 row in table , I'm using this code:</p>
  
  <pre><code>string id = // still keep the old id, this's the PK of table;
  string lyric = //get new lyric;
  string cover = // get new cover;
  Video item = new Video(){Id = id, Lyric = lyric, Cover = cover};
  SQLiteAccess.EditVideoInfo(item);
  </code></pre>
  
  <p>Here's the EditVideoInfo</p>
  
  <pre><code>public static void EditVideoInfo(Video item)
      {
          var conn = new SQLiteConnection(mypath);
          using (conn)
          {
              var list = conn.Query&lt;Video&gt;("SELECT * FROM Video WHERE Id =?", item.Id);
              if (list.Count &gt;0)
              {
                  var editItem = list.First();  // -&gt; Get the item need to updated
                  /// Here's where I'm stuck
                  conn.Update(editItem);                    
              }
          }
      }
  </code></pre>
  
  <p>So how can I read "foreach" each property of the new item and update to the old item's property if that property isn't null ?</p>