Ejemplo n.º 1
0
        public virtual void Create(ItemCreatedEvent message)
        {
            string insertText = "INSERT INTO inventory(id,version) VALUES(@id,@version)";

            using (var conn = new MySqlConnection())
            {
                var mysqlConn = System.Configuration.ConfigurationManager.ConnectionStrings["mysqlConn"].ConnectionString;
                conn.ConnectionString = mysqlConn;
                conn.Open();
                MySqlHelper.ExecuteNonQuery(
                    conn,
                    insertText,
                    new MySqlParameter[] { new MySqlParameter("@id", message.Id),
                                           new MySqlParameter("@version", message.Version) }
                    );
                conn.Close();
            }
        }
Ejemplo n.º 2
0
 public virtual void Create(ItemCreatedEvent message)
 {
     string insertText = "INSERT INTO inventory(id,version) VALUES(@id,@version)";
     using (var conn = new MySqlConnection())
     {
         var mysqlConn = System.Configuration.ConfigurationManager.ConnectionStrings["mysqlConn"].ConnectionString;
         conn.ConnectionString = mysqlConn;
         conn.Open();
         MySqlHelper.ExecuteNonQuery(
             conn,
             insertText,
             new MySqlParameter[] { new MySqlParameter("@id", message.Id),
             new MySqlParameter("@version", message.Version)
             }
             );
         conn.Close();
     }
 }