The StringToEnum method in Utilities.cs provides a generic way to convert a string to an enum. This is a useful utility function, but its location in a general Utilities class can be refactored into a more specific utility class focused on type conversion or string manipulation within the core layer.
Action:
- Create a new core-level utility class for type conversion or string utilities (e.g.,
TypeConverterUtils.cs or StringUtils.cs).
- Move the
StringToEnum method to this new class.
- Update any code that uses
StringToEnum to reference the new class.
- Add or update tests for the string-to-enum conversion logic.
The
StringToEnummethod inUtilities.csprovides a generic way to convert a string to an enum. This is a useful utility function, but its location in a generalUtilitiesclass can be refactored into a more specific utility class focused on type conversion or string manipulation within the core layer.Action:
TypeConverterUtils.csorStringUtils.cs).StringToEnummethod to this new class.StringToEnumto reference the new class.