Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit bf7f0fb

Browse files
committed
Fix SqlFmt test for Pgsql naming convention
1 parent 80263de commit bf7f0fb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/ServiceStack.OrmLite.Tests/EnumTests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,8 +477,10 @@ public void Can_query_EnumMembers_with_SqlFmt()
477477

478478
var id = 1;
479479
db.Insert(new TypeWithEnumMember {Id = id, WorkflowType = WorkflowType.PurchaseInvoice});
480+
var q = db.From<TypeWithEnumMember>();
480481
var result = db.Single<TypeWithEnumMember>(
481-
"select * from " + db.GetTableName<TypeWithEnumMember>() + " as db where db.Id = {0} and db.WorkflowType = {1}".SqlFmt(id, WorkflowType.PurchaseInvoice));
482+
("select * from " + q.Table<TypeWithEnumMember>() + " as db where db.Id = {0} and db."
483+
+ q.Column<TypeWithEnumMember>(x => x.WorkflowType) + " = {1}").SqlFmt(id, WorkflowType.PurchaseInvoice));
482484
Assert.That(result.WorkflowType, Is.EqualTo(WorkflowType.PurchaseInvoice));
483485
}
484486
}

0 commit comments

Comments
 (0)