OnCommand not work
Closed this issue · 3 comments
davidhxy678 commented
When I want to set the CommandTimeout like this way,SqlFuDao.OnCommand = cmd => cmd.CommandTimeout = 120,OnCommand not work.
I read the source code,and find that in the sqlFu.sqlFuDao.cs GetRawValue() ,
OnCommand(cmd) need to put front of the rez = cmd.ExecuteScalar(),Is it that right?
sapiens commented
OnCommand is meant for logging purposes. What you want is
db.WithSql(sql,args).Apply(cmd=>cmd.CommandTimeout = 120 ).Query<MyType>()
davidhxy678 commented
thanks.Howerver,if I want to use CrudHelpers.Insert,how to set the CommandTimeout?
sapiens commented
Currently, there aren't any helpers that accept configuration of DbCommand. I'll add that in the future