Skip to content

Commit

Permalink
fix: make parameter type of ToEnum extension methods dynamic (#2064) (#…
Browse files Browse the repository at this point in the history
…2089)

* fix: make parameter type of ToEnum extension methods dynamic (#2064)

Co-authored-by: jespitae <jens.spitaels@telenet.be>
Co-authored-by: Jens Spitaels <Jens.Spitaels@alsic.be>
  • Loading branch information
3 people authored Aug 13, 2024
1 parent 821cc1b commit fcb4eab
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static class OrderStatusExtensions
return null;
}
public static OrderStatus? ToOrderStatus(int? value)
public static OrderStatus? ToOrderStatus(dynamic? value)
{
switch (value)
{
Expand Down
4 changes: 1 addition & 3 deletions src/generators/csharp/renderers/EnumRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ return null;`;
${this.indent(enumValueSwitch)}
}
public static ${this.model.name}? To${this.model.name}(${
this.model.type
}? value)
public static ${this.model.name}? To${this.model.name}(dynamic? value)
{
${this.indent(valueSwitch)}
}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public static class StatesExtensions
return null;
}
public static States? ToStates(string? value)
public static States? ToStates(dynamic? value)
{
switch (value)
{
Expand Down

0 comments on commit fcb4eab

Please sign in to comment.