Closed freetison closed 6 years ago
Why do you use 'field' and not 'property'. I think this is the problem.
Thanks for answer and your incredible work. You are right.. It's fix using properties.
Thanks for answer and your incredible work. You are right.. It's fix using properties.
How can you fix this? I've the same problem when using DateTime. Ex: (t.CreatedDate.Subtract(currentDate).Days == 0)
@tonnystark It is difficult query for parse. You can use SQL directly in Dapper.
L direct
Thanks for your comment, I'll do that.
I am trying to replicate the MsSqlRepositoriesTests but I received this runtime error: System.NotSupportedException: 'predicate can't parse'
POCO class
[Table("TestTableSize")] public class TestTableSize { [Column(TypeName = "varchar"), MaxLength(10)] public string MyKeyField; // varchar(10), not null
--Code--- var testConnectionString = "Data Source=DOOM\SCOM;Initial Catalog=testAdminSQL;Integrated Security=True";
MsSqlDbContext db = new MsSqlDbContext(testConnectionString); var test = db.TestTableSize.Find(x => x.MyKeyField == "0002720715"); // Exception