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

Move ToSerial and ToEnum to SerializationProviders from EnumProvider class #3651

Open
nisha-bhatia opened this issue Jun 24, 2024 · 1 comment · May be fixed by #3795
Open

Move ToSerial and ToEnum to SerializationProviders from EnumProvider class #3651

nisha-bhatia opened this issue Jun 24, 2024 · 1 comment · May be fixed by #3795
Assignees
Labels
emitter:client:csharp Issue for the C# client emitter: @typespec/emitter-client-csharp

Comments

@nisha-bhatia
Copy link
Contributor

nisha-bhatia commented Jun 24, 2024

Currently ToSerial and ToEnum are on the EnumProvider class. They do not belong here - as they are currently used for serialization. If we move To{Type.Name} to SerializationProviders we can ensure that the method will always have an implementation (in case the enum is overriden and doesn't have a ToName method).

Addresses this comment: #3621 (comment)

@nisha-bhatia nisha-bhatia added the emitter:client:csharp Issue for the C# client emitter: @typespec/emitter-client-csharp label Jun 24, 2024
@ArcturusZhang
Copy link
Member

So I think we have a contradiction with the comment here if make the suggested change here: #3642 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
emitter:client:csharp Issue for the C# client emitter: @typespec/emitter-client-csharp
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants