Add SqlFormat to format ParameterPrefix,QuotePrefix,QuoteSuffix easily
shps951023 opened this issue · 1 comments
shps951023 commented
e.g
using (var cn = Db.GetConnection())
{
var result = Db.SqlFormat("select * from {1}orders{2} where id = {0}id");
Assert.Equal("select * from [orders] where id = @id", result);
}
shps951023 commented
Version 0.9.6
- Add SqlFormat , e.g:
var sql = Db.SqlFormat("select * from {1}orders{2} where id = {0}id");
//if db is sqlserver
Assert.Equal("select * from [orders] where id = @id", sql);
//if db is oracle
Assert.Equal("select * from \"orders\" where id = :id", sql);