Skip to content

Commit

Permalink
check the implements to identify if it is ClientOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
chunyu3 committed Oct 16, 2024
1 parent 884ec82 commit 2f4a940
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT License.

using System;
using System.ClientModel.Primitives;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Generator.CSharp.ClientModel.Providers;
Expand Down Expand Up @@ -39,7 +40,8 @@ internal class StubLibraryVisitor : ScmLibraryVisitor
return null;
}

if (type is ClientOptionsProvider clientOptions)
/* remove constructors for ClientOptions */
if (type.Implements.Any(i => i.Equals(typeof(ClientPipelineOptions))))
{
type.Update(constructors: []);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace Microsoft.Generator.CSharp.ClientModel.Providers
{
public class ClientOptionsProvider : TypeProvider
internal class ClientOptionsProvider : TypeProvider
{
private const string LatestVersionFieldName = "LatestVersion";
private const string VersionPropertyName = "Version";
Expand Down

0 comments on commit 2f4a940

Please sign in to comment.