DapperLib / DapperLib/Dapper

DynamicParameters.ParameterNames does not provide names from "template" objects

Open
#343 3 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs-investigation
Dominant language
C#
Stars
18.4k
Forks
3.7k
Avg merge
5h 8m
Merged PRs (30d)
1

Description

Example
var dynamic = new DynamicParameters(new { test = "Test" });
Assert.IsTrue(dynamic.ParameterNames.Contains("test")); // fails
Use case

I have a method that accepts two objects and merges them into a single parameter set.
Since AddDynamicParams does not fail if same names exist in both objects, I need a way to check it myself before merging them.

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 by locating DynamicParameters and reviewing how ParameterNames and AddDynamicParams handle template objects. Add a regression test based on the provided example, and verify that ParameterNames includes names from constructed template parameters while preserving the merging use case.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.