Builder Pattern as Ref Struct
Hey all, I'm trying to make a source-generated builder which I want to be a struct. I'm running into a problem when trying to chain the entire build, but if I capture the builder in a variable first I can chain it as much as I like. Wondering if there's any language feature/etc that would help me out here? What I'd like is to use the same builder struct instance and not have to copy it with each chained method.
EDIT:
The problem occurs because the extension method operates on a
EDIT:
The problem occurs because the extension method operates on a
ref of the instance, so I must have a field/variable declared beforehand of the type. This means I can't just call new().Extension(), as the result of new() must be assigned to something before it can be used. That is what I am trying to resolve.