Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for dynamic record creation including list-like properties #49

Closed
kzu opened this issue Nov 10, 2022 · 0 comments · Fixed by #50
Closed

Add support for dynamic record creation including list-like properties #49

kzu opened this issue Nov 10, 2022 · 0 comments · Fixed by #50
Labels
enhancement New feature or request

Comments

@kzu
Copy link
Member

kzu commented Nov 10, 2022

Given the following records:

public partial record Point(int X, int Y);

public partial record Line(Point Start, Point End);

public partial record Buffer(IReadOnlyCollection<Line> Lines);

public partial record OnDidEdit(Buffer Buffer);

If they are defined in different assemblies, the dynamic conversion we perform via generated record factories should also support recreating the Lines property for the Buffer.

We should support anything that can be assigned from an List<T>, such as IEnumerable<T>, ICollection<T> and so on.
We should also support arrays.

kzu added a commit that referenced this issue Nov 10, 2022
Any property or constructor argument that can be assigned from a List<T> is supported, as well as plain arrays.

Closes #49
kzu added a commit that referenced this issue Nov 10, 2022
Any property or constructor argument that can be assigned from a List<T> is supported, as well as plain arrays.

Closes #49
@kzu kzu closed this as completed in #50 Nov 10, 2022
kzu added a commit that referenced this issue Nov 10, 2022
Any property or constructor argument that can be assigned from a List<T> is supported, as well as plain arrays.

Closes #49
@kzu kzu added the enhancement New feature or request label Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant