Minor documentation bug with anonymous types & parameters
Open
Beginner friendly
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 18.4k
- Forks
- 3.7k
- Avg merge
- 5h 8m
- Merged PRs (30d)
- 1
Description
Super minor documentation bug, but on https://www.learndapper.com/parameters it says
Or you can pass an anonymous type:
var parameters = new DynamicParameters({ ProductId = 1 }); var sql = "select * from products where ProductId = @ProductId"; using (var connection = new SqlConnection(connString)) { var product = connection.QuerySingle<Product>(sql, parameters); }
when I think it should say
var parameters = new DynamicParameters(new { ProductId = 1 });
to get it to compile.
Thanks for the hard work with Dapper!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open the parameters page at https://www.learndapper.com/parameters and inspect the anonymous-type example. Correct the constructor call so the example uses the syntax shown in the issue, then verify that the documented snippet compiles as written.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100