DapperLib / DapperLib/Dapper.Contrib
Inherited TableAttribute is ignored by CRUD operations
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 293
- Forks
- 109
- PR merge metrics
- No merged PRs in 30d
Description
The TableAttribute is inherited to subclasses but then ignored by the CRUD operations. This is due to the method SQLMapperExtensions.GetTableName ignoring inherited CustomAttributes.
This feels wrong since the attribute is actually being inherited and attributes on property level are not being ignored, e.g.: properties with ExplicitKeyAttribute
Currently you have to either specify the table name for every subclass or make use of SQLMapperExtensions.TableMapper.
Is this behaviour wanted?
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 in src/Dapper.Contrib/SqlMapperExtensions.cs at GetTableName and compare its CustomAttributes handling with the ExplicitKeyAttribute handling around the referenced lines. Verify how inherited TableAttribute values flow through CRUD operations and determine whether those operations should use the inherited table name rather than requiring TableMapper or repeated attributes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- database
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100