Ejemplo n.º 1
0
        public static int AddMessage(ChatMessage model)
        {
            using (MySqlDbConnection con = MySqlDbConnection.Connect())
            {
                con.CommandText = "insert into chatmessage (Mid, UserId, Message, CreateDate) values (@Mid, @UserId, @Message, @CreateDate)";
                con.AddParameters("Mid", model.Mid);
                con.AddParameters("UserId", model.UserId);
                con.AddParameters("Message", model.Message);
                con.AddParameters("CreateDate", model.CreateDate);

                return con.Exec();
            }
        }