Skip to content

[http-client-csharp] [Feature Request] Support CodeGenMember for methods #10526

@ArcturusZhang

Description

@ArcturusZhang

Now CodeGenMember attribute only supports properties, could we make it to support methods?

Also when we use CodeGenMember attribute, we MUST rewrite EVERYTHING for that property. This is quite inconvenient - sometimes we only want to change its name. Could we introduce a new kind usage so that CodeGenMember could be added to the enclosing class, using the name of its member as the first argument? (Similar syntax like decorators in typespec) like this:

[CodeGenMember(nameof(Bar), "NewBar")]
public partial class Foo
{
}

For renaming methods, it could be something like

[CodeGenMember(nameof(GetAsync), new[] {typeof(string)}, "NewGetAsync"]
public partial class Foo
{
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    emitter:client:csharpIssue for the C# client emitter: @typespec/http-client-csharpfeatureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions