public void Update(EntityBase entity)
 {
     var session = SessionManager.Manager.Current;
     Debug.Assert(session != null);
     try
     {
         var connection = session.DbInfo.Connection;
         var lockManager = SessionManager.Manager.LockManager;
         using(var command = connection.CreateCommand())
         {
             command.CommandType = CommandType.Text;
             command.CommandText = GetUpdateSQL(entity);
             command.Transaction = session.DbInfo.Transaction;
             var rows = command.ExecuteNonQuery();
             lockManager.ReleaseLock(entity.Id, session.Id); // Release lock
         }
     }
     catch(DbException dbe)
     {
         throw new Exception("Unexpected error updating: " + dbe.Message);
     }
 }
 protected override string GetUpdateSQL(EntityBase entity)
 {
     var customer = (Customer)entity;
     return string.Format(UPDATE_SQL, customer.Name, customer.Id);
 }
 protected abstract string GetUpdateSQL(EntityBase entity);
 public void Add(Guid key, EntityBase value)
 {
     Debug.Assert(!this.entities.ContainsKey(key));
     this.entities.Add(key, value);
 }