DapperLib / DapperLib/Dapper.Contrib

GetAll<T> only supports an entity with a single [Key] or [ExplicitKey] property. [Key] Count: 0, [ExplicitKey] Count: 2

Open
#93 6 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
293
Forks
109
PR merge metrics
No merged PRs in 30d

Description

[Table("MyTable")]
public class TableEntity
{
    [ExplicitKey]
    public string Name { get; set; }
    [ExplicitKey]
    public Guid Id { get; set; }
}

The error happens when calling

return await GetAllAsync<MyTable>();

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 at the GetAllAsync entry point named in the report and trace the validation that rejects the two ExplicitKey properties. Use the provided TableEntity reproduction to understand the current behavior; the issue does not define the intended composite-key behavior, so completion requires establishing that expected behavior and covering it with a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend, database
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.