Skip to content

Custom naming convention for generated code #429

@BalassaMarton

Description

@BalassaMarton

As a developer, I'd like to customize the orchestrator/activity name that is generated for my classes annotated with DurableTaskAttribute.
The generator currently uses the target type's local name by default. This is not sufficient if there are many unrelated orchestrators and activities in the project in different namespaces, or if the Task Hub is shared between multiple services (for whatever reason).
The best would be a few properties that I can pass to the build from the project file, e.g.

<PropertyGroup>
    <!-- Configure the default for orchestrators, activities and events -->
    <DurableTaskDefaultNamingPolicy>FullName</DurableTaskDefaultNamingPolicy>

    <!-- Configure the default for orchestrators separately -->
    <DurableTaskOrchestratorDefaultNamingPolicy>FullName</DurableTaskOrchestratorDefaultNamingPolicy>
</PropertyGroup>

Possible values can be Name (current behavior), FullName, AssemblyQualifiedName - the names should be generated using the corresponding property of the target Type.

The current workaround is to always provide the name in the DurableTask annotation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions