Request: Providing object instance to Dapper
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 18.4k
- Forks
- 3.7k
- Avg merge
- 5h 8m
- Merged PRs (30d)
- 1
Description
Is it possible to implement a feature to give Dapper the instance which we want to set the properties? I mean, I don't want Dapper to create a new instance for the object when it reads the rows. I want it to let us create and provide the instance.
I need this because I've to use dynamic proxies on those objects. And for performance and memory reasons, it won't be good if I create a new proxy instance for every returned object from Dapper which will just double the total of instances.
I have found an old StackOverflow question and @mgravell mentioned that it is possible to implement.
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
No file, test, or entry point is named in the issue. Start by tracing Dapper's existing row-to-object materialization flow and review the linked Stack Overflow discussion for the intended behavior. Done means a supported way to populate caller-provided instances without creating replacement objects, with tests covering that behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- database
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100