Dapper - Parameter String

Description

  1. var sql = "SELECT * FROM Invoice WHERE Code = @Code;";
  2. using (var connection = My.ConnectionFactory())
  3. {
  4. connection.Open();
  5. var invoices = connection.Query<Invoice>(sql, new {Code = new DbString {Value = "Invoice_1", IsFixedLength = false, Length = 9, IsAnsi = true}}).ToList();
  6. My.Result.Show(invoices);
  7. }