Skip to content

Option to append Async to server side method names #39010

Open
@johan-lindqvist

Description

@johan-lindqvist

Is your feature request related to a problem? Please describe.

Currently if I have a proto file with the following:

service MyService {
	rpc MyMethod (MyRequest) returns (MyReply);
}

It will generate a C# method with the following format:

public override async Task<MyReply> MyMethod(MyRequest request, ServerCallContext context)

Describe the solution you'd like

It would be nice if there was an option to append Async to these generated methods to keep with the general naming convention in C# where asynchronous methods are suffixed with Async. Which will otherwise trigger analyzer warnings.

The desired generated code would be:

public override async Task<MyReply> MyMethodAsync(MyRequest request, ServerCallContext context)

Describe alternatives you've considered

Disabling the analyzer warnings, but that seems the wrong approach.

Additional context

This feature was requested in #7874 a very long time ago but has since then been locked so I couldn't add a comment there instead, hence the new issue.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions