Skip to content

fix(dotnet): keep a resource property apart from its class name - #66

Closed
moetemp wants to merge 1 commit into
moe/up/resource-method-record-resultfrom
moe/up/dotnet-resource-property-name-2
Closed

moetemp wants to merge 1 commit into
moe/up/resource-method-record-resultfrom
moe/up/dotnet-resource-property-name-2

Conversation

@moetemp

@moetemp moetemp commented Oct 23, 2026

Copy link
Copy Markdown
Owner

What changed?

This PR adds Value to a .NET resource property that has the name of its class, as SessionValue on Session. The constructor parameter and the method requests use the same name.

Why?

C# refuses a member with the name of its class (CS0542), so a session resource with a session field didn't compile.

How did you test it?

The user-service sample gains a session resource with a session field, and its .NET golden shows SessionValue. A sample test round-trips a Session through the payload converter, since System.Text.Json binds the constructor parameter by the property name.

Based on fork PR #61. Replaces fork PR #63.

@moetemp moetemp changed the title [UPSTREAM-2] fix(dotnet): keep a resource property apart from its class name fix(dotnet): keep a resource property apart from its class name Oct 23, 2026
@moetemp

moetemp commented Oct 23, 2026

Copy link
Copy Markdown
Owner Author

Opened upstream as temporalio#272.

@moetemp moetemp closed this Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant