Add entity source generation support for Durable Functions#533
Merged
YunchuWang merged 5 commits intomainfrom Dec 6, 2025
Merged
Add entity source generation support for Durable Functions#533YunchuWang merged 5 commits intomainfrom
YunchuWang merged 5 commits intomainfrom
Conversation
Co-authored-by: YunchuWang <12449837+YunchuWang@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add durable function entity source generation support and tests
Add entity source generation support for Durable Functions
Dec 5, 2025
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds source generation support for Durable Task entities in Azure Functions scenarios. Previously, the source generator only produced function triggers for orchestrators and activities when using the class-based [DurableTask] attribute syntax. This change brings entities to feature parity by generating [EntityTrigger] function definitions.
Key Changes:
- Added
AddEntityFunctionDeclarationmethod to generate entity trigger functions - Added 4 comprehensive test methods covering primitive types, inheritance, custom state types, and mixed scenarios
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Generators/DurableTaskSourceGenerator.cs | Added entity function generation logic in the Execute method and implemented the AddEntityFunctionDeclaration helper method following existing patterns |
| test/Generators.Tests/AzureFunctionsTests.cs | Added 4 test methods validating entity generation across different scenarios including primitive types, inheritance, custom state types, and mixed orchestrator/activity/entity usage |
Member
|
sample is fixed, all source generation work as expected |
kaibocai
approved these changes
Dec 6, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The source generator was not producing Azure Function triggers for entities when using the class-based syntax with
[DurableTask]attribute, unlike orchestrators and activities which already had this support.Changes
AddEntityFunctionDeclarationmethod that generates[EntityTrigger]function definitions for entity classes decorated with[DurableTask]Example
Given:
The generator now produces:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.