public void Execute(Entities.ChatMessage message)
{
using (DbCommand cmd = db.GetStoredProcCommand("ChatMessage_Insert"))
{
db.AddInParameter(cmd, "@SentByUserId", DbType.Int32, message.SentByUserId);
db.AddInParameter(cmd, "@SentByUserName", DbType.String, message.SentBy.HTMLEncode());
db.AddInParameter(cmd, "@Message", DbType.String, message.Message.HTMLEncode());
db.AddInParameter(cmd, "@DateSent", DbType.DateTime, message.SentDate);
db.AddInParameter(cmd, "@GameID", DbType.Int32, message.GameID);
db.AddInParameter(cmd, "@Global", DbType.Boolean, message.Global);
db.AddInParameter(cmd, "@ConnectionType", DbType.Int32, message.ConnectionType);
db.ExecuteScalar(cmd);
}
}