I have a suggestion that I hope dapper writers will take it seriously and implement it.
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 18.4k
- Forks
- 3.7k
- Avg merge
- 5h 8m
- Merged PRs (30d)
- 1
Description
1.Dapper does not support mapping of anonymous types well and has serious bugs
2.The advantage of anonymity, I don't have to say much about it.
3.What about his relationship with Dapper?
Example1
I have a type Student (id, age, sex, sid) and a school (sid, sname)。
I get the (id, age, sname) of these two types by connecting queries, but I don't want to define a new type.
public List<TResult> Query<TResult> Query(Func<T1,T2,TResult> fun,string sql)
{
return connection.Query<TResult>(sql);
}
I have defined the following methods, which can be solved
var list = Query((stu,sch)=>new
{
stu.Id,
stu.Age,
sch.sname
},"select id,age,sname from student join school on student.sid=school.sid")
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
Start with the generic Query entry point shown in the issue and review how Dapper currently maps joined SQL results. The requested outcome is support for projecting joined Student and school data into an anonymous result without defining a new type; existing mapping behavior and tests would need to establish the scope.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, sql
- Domain
- backend-api-design, databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100