DapperLib / DapperLib/Dapper

I have a suggestion that I hope dapper writers will take it seriously and implement it.

Open
#1,305 19 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.