【发布时间】:2012-04-05 02:14:27
【问题描述】:
如何让 Dapper.NET 对我的 Oracle 数据库进行 CRUD?
我有一个表名为:PLAYER_LOG 它的身份是由触发器完成的,这里是 sql
SELECT SQ_MASTER_SEQUENCE.NEXTVAL INTO tmpVar FROM dual;
:NEW.ID := tmpVar;
我的模特是:
public class PlayerLogStorage : IEntity //-> here is the identity
{
public string Cli { get; set; }
public string PlayerAnswer { get; set; }
public DateTime InsertDate { get; set; }
}
这是我的插入:
using (IDbConnection ctx = DbConnectionProvider.Instance.Connection)
{
ctx.Query<PlayerLogStorage>("INSERT INTO PLAYER_LOG (CLI, ANSWER, INSERT_DATE) VALUES (:Cli, :PlayerAnswer, :InsertDate)", new
{
Cli = model.Cli,
PlayerAnswer = model.PlayerAnswer,
InsertDate = model.InsertDate
});
}
这里是个例外:
ORA-01008: not all variables bound
【问题讨论】: