DapperLib / DapperLib/Dapper.Contrib
Dapper Contrib - InsertAsync typeof not correct
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 293
- Forks
- 109
- PR merge metrics
- No merged PRs in 30d
Description
Hi all,
In my Azure Function custom output binding I have problem with Insert method.
My T entity is an interface, but at runtime I have concrete type.
I change this line of code in my scenario:
https://github.com/StackExchange/Dapper/blob/d19d6012e75feebf24d591ad21b16f13becc95f2/Dapper.Contrib/SqlMapperExtensions.Async.cs#L142
This is my resolution:
var type = entityToInsert.GetType();
Do you think that this is correct fix in all scenario?
Thanks a lot
P.S. my sample is here:
https://github.com/andreatosato/GAB2019/blob/c7ad8e222aa195685155135c7898319b4a936e14/AzureFunctionDeepDive/DeepDive.Extension.SQLBinding/Output/SqlOutputConfigurationProvider.cs#L20
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 Dapper.Contrib/SqlMapperExtensions.Async.cs at line 142 and compare the declared interface type with the concrete runtime type described in the issue. Review the linked Azure Function sample files to understand how InsertAsync is called. Done means determining whether the proposed runtime-type lookup is correct across the reported scenarios and documenting or validating the result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 32/100