I want to know if there are any recommendations with query parameters
Is it ok to pass the whole object or is it better to create a lightweight anonymous object with properties I need?
Query<SomeObj>("Select * from SomeObjs where Id = @Id", someObj);
or
Query<SomeObj>("Select * from SomeObjs where Id = @Id", new {someObj.Id});
Are there any performance or memory implications for one over other?
For how Dapper works, by creating and caching the mapping code on the fly at the first use, it doesn't really matter.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With