Skip to content

C# Api Client generation: how to ignore a controller from external source? #4628

Answered by ogulcanturan
ImreMedgyesi asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @ImreMedgyesi , you can hide external libraries controllers using Conventions - whether only one controller or whole assembly

ControllerHideFromExploringConvention copy this class,

Extensions

public static void AddControllerHideFromExploringConvention<TController>(this IList<IApplicationModelConvention> conventions, bool inherit = true)
{
    AddControllerHideFromExploringConvention(conventions, typeof(TController), inherit);
}

public static void AddControllerHideFromExploringConvention(this IList<IApplicationModelConvention> conventions, Type controllerType, bool inherit = true)
{
    if (conventions == null)
    {
        throw new ArgumentNullException(nameof(conventions));
    }
…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ImreMedgyesi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #4627 on December 06, 2023 15:21.