title: Creating an Update method in my nHibernate repository
body: <p>My current repository looks like:</p>
  
  <pre><code> public class Repository&lt;T&gt; : IRepository&lt;T&gt;
      {
  
          public ISession Session
          {
              get 
              { 
                  return SessionProvider.GetSession(); 
              }
          }
  
  
          public T GetById(int id)
          {
              return Session.Get&lt;T&gt;(id);
          }
  
          public ICollection&lt;T&gt; FindAll()
          {
              return Session.CreateCriteria(typeof(T)).List&lt;T&gt;();
          }
  
          public void Add(T t)
          {
              Session.Save(t);
          }
  
          public void Remove(T t)
          {
              Session.Delete(t);
          }
  
  
      }
  </code></pre>
  
  <p>the interface:</p>
  
  <pre><code> public interface IRepository&lt;T&gt;
      {
          T GetById(int id);
          ICollection&lt;T&gt; FindAll();
          void Add(T entity);
          void Remove(T entity);
      }
  </code></pre>
  
  <p>How would I create an update method?</p>
  
  <p>Do I have to call flush or transaciton commit to write to the database?</p>
  
  <p>I have tried updating an object, and calling saveorupdate(); but it didn't change the value in the db.</p>