dotnet / dotnet/command-line-api

Access DI container in validator methods

Open
#1,460 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
3.7k
Forks
428
PR merge metrics
No merged PRs in 30d

Description

Some of my validations require access to the DI container. I know I can create a Middleware to short-circuit the pipeline, but how can I take advantage of the error reporting middleware built into the API? I tried assigning a Validator to a Command from a Middleware but it never gets called.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.