Dapper dynamic parameters throw a SQLException “must define scalar variable” when not using anonymous objects
Implement your model with properties, not fields: class MyAccount { public string Name { get; set; } public int Priority { get; set; } } Dapper looks at the properties of the object to get parameters, ignoring fields. Anonymous types work because they are implemented with properties.