dotnet / orleans

Cloud Native application framework for .NET
https://docs.microsoft.com/dotnet/orleans
MIT License
9.89k stars 2.01k forks source link

GenerateSerializer models don't work with `required` properties #8960

Closed zpxp closed 3 weeks ago

zpxp commented 1 month ago

Using the required keyword on properties on a class that is decorated with [GenerateSerializer] results in compile exceptions

[GenerateSerializer]
public class SomeClass 
{
    [Id(1)] public required string Name { get; set; }
}
Orleans.CodeGenerator.OrleansSerializationSourceGenerator/Game.orleans.g.cs(1941,34): error CS9035: Required member 'SomeClass.Name' must be set in the object initializer or attribute constructor.
ReubenBond commented 1 month ago

Which version of Orleans are you using, @zpxp? This ought to have been fixed by this PR: https://github.com/dotnet/orleans/pull/8595

dotnet-policy-service[bot] commented 4 weeks ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

zpxp commented 4 weeks ago

Which version of Orleans are you using, @zpxp? This ought to have been fixed by this PR: #8595

We are using 7.2.1

ReubenBond commented 3 weeks ago

@zpxp this was fixed in v7.2.2