Skip to content

Fix review feedback: double semicolon, DI condition integration test, docs example#4601

Merged
jbogard merged 2 commits into4562-dependency-injection-in-conditionsfrom
copilot/sub-pr-4599
Feb 20, 2026
Merged

Fix review feedback: double semicolon, DI condition integration test, docs example#4601
jbogard merged 2 commits into4562-dependency-injection-in-conditionsfrom
copilot/sub-pr-4599

Conversation

Copy link
Contributor

Copilot AI commented Feb 20, 2026

Addresses review comments on the DI-enabled conditions PR. Three issues corrected:

  • LicenseAccessor.cs:57 — Remove stray extra semicolon (}; ;};)
  • Docs example — Replace MapperConfiguration with services.AddAutoMapper(...) in the class-based conditions DI example; the old example wouldn't trigger automatic condition registration
  • DI integration test — Add ConditionDependencyTests to AutoMapper.DI.Tests demonstrating constructor-injected dependencies in a condition class resolved via AddAutoMapper:
public class DependencyCondition : ICondition<ConditionSource, ConditionDest, int>
{
    private readonly ISomeService _service;
    public DependencyCondition(ISomeService service) => _service = service;

    public bool Evaluate(ConditionSource source, ConditionDest destination,
        int sourceMember, int destMember, ResolutionContext context)
        => _service.Modify(sourceMember) > 0;
}

// Registered automatically via AddAutoMapper; ISomeService injected by DI container
services.AddTransient<ISomeService>(sp => new FooService(5));
services.AddAutoMapper(_ => { }, typeof(ConditionSource));

Also updates three existing ShouldConfigureProfiles type-map count assertions (4 → 5) to account for the new ConditionProfile map.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

… update docs

Co-authored-by: jbogard <104498+jbogard@users.noreply.github.com>
Copilot AI changed the title [WIP] Add DI support for conditions and pre-conditions in AutoMapper Fix review feedback: double semicolon, DI condition integration test, docs example Feb 20, 2026
Copilot AI requested a review from jbogard February 20, 2026 20:17
@jbogard jbogard marked this pull request as ready for review February 20, 2026 20:25
@jbogard jbogard merged commit 7e9f34a into 4562-dependency-injection-in-conditions Feb 20, 2026
3 checks passed
@jbogard jbogard deleted the copilot/sub-pr-4599 branch February 20, 2026 20:37
This was referenced Mar 14, 2026
mlapaglia pushed a commit to mlapaglia/OpenAlprWebhookProcessor that referenced this pull request Mar 23, 2026
Updated [AutoMapper](https://github.com/LuckyPennySoftware/AutoMapper)
from 16.0.0 to 16.1.1.

<details>
<summary>Release notes</summary>

_Sourced from [AutoMapper's
releases](https://github.com/LuckyPennySoftware/AutoMapper/releases)._

## 16.1.1

## What's Changed
* Better async handling of license validation; fixes #​4612 by @​jbogard
in LuckyPennySoftware/AutoMapper#4613
* More artifacts for builds (test results and SBOM) by @​jbogard in
LuckyPennySoftware/AutoMapper#4615
* Update Microsoft.Sbom.DotNetTool to 4.1.5 by @​jbogard in
LuckyPennySoftware/AutoMapper#4616

## Security

Fixed an issue where certain cyclic or self-referential object graphs
could trigger uncontrolled recursion during mapping, potentially
resulting in stack exhaustion and denial of service.

Applications that process untrusted or attacker-controlled object graphs
through affected mapping paths may be impacted.

Users should upgrade to this release.

Security advisory: GHSA-rvv3-g6hj-g44x

Thanks to @​bluefossa for responsibly disclosing this issue.


**Full Changelog**:
LuckyPennySoftware/AutoMapper@v16.1.0...v16.1.1

## 16.1.0

## What's Changed
* Add Debug and Release build configurations to slnx by @​Copilot in
LuckyPennySoftware/AutoMapper#4590
* Migrating to slnx by @​jbogard in
LuckyPennySoftware/AutoMapper#4589
* Allow disabling of polymorphic LINQ mapping by @​jbogard in
LuckyPennySoftware/AutoMapper#4596
* Fix duplicate BOM in ServiceCollectionExtensions.cs by @​Copilot in
LuckyPennySoftware/AutoMapper#4600
* Fix review feedback: double semicolon, DI condition integration test,
docs example by @​Copilot in
LuckyPennySoftware/AutoMapper#4601
* Adding DI-enabled conditions and pre-conditions; updated docs accordi…
by @​jbogard in
LuckyPennySoftware/AutoMapper#4599
* Adding support for DI-enabled destination factories. by @​jbogard in
LuckyPennySoftware/AutoMapper#4603
* Correctly converting nullables for MapAtRuntime; fixes #​4597 by
@​jbogard in LuckyPennySoftware/AutoMapper#4604
* Correctly handling consecutive uppercase characters; fixes #​4593 by
@​jbogard in LuckyPennySoftware/AutoMapper#4605
* Wrapping the exception to provide better feedback to the user; fixes …
by @​jbogard in
LuckyPennySoftware/AutoMapper#4606
* Fixing bug around order of open generic registration by @​jbogard in
LuckyPennySoftware/AutoMapper#4607
* Adding perpetual licensing by @​jbogard in
LuckyPennySoftware/AutoMapper#4608

## New Contributors
* @​Copilot made their first contribution in
LuckyPennySoftware/AutoMapper#4590

**Full Changelog**:
LuckyPennySoftware/AutoMapper@v16.0.0...v16.1.0

Commits viewable in [compare
view](LuckyPennySoftware/AutoMapper@v16.0.0...v16.1.1).
</details>

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=AutoMapper&package-manager=nuget&previous-version=16.0.0&new-version=16.1.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/mlapaglia/OpenAlprWebhookProcessor/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants