Skip to content

Refactor MethodWrapper and add ConvertParameterStringToEnum utility#29

Merged
IvanMurzak merged 3 commits intomainfrom
refactoring/other
Nov 11, 2025
Merged

Refactor MethodWrapper and add ConvertParameterStringToEnum utility#29
IvanMurzak merged 3 commits intomainfrom
refactoring/other

Conversation

@IvanMurzak
Copy link
Copy Markdown
Owner

Streamline method creation logic in MethodWrapper and introduce a utility for converting string parameters to enum types.

…gic and add ConvertParameterStringToEnum utility
@IvanMurzak IvanMurzak self-assigned this Nov 11, 2025
@IvanMurzak IvanMurzak added the enhancement New feature or request label Nov 11, 2025
@IvanMurzak IvanMurzak requested a review from Copilot November 11, 2025 04:28
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Nov 11, 2025

Test Results

    3 files  ±0      3 suites  ±0   3m 16s ⏱️ +6s
  567 tests ±0    567 ✅ ±0  0 💤 ±0  0 ❌ ±0 
1 663 runs  ±0  1 663 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 51ea4a0. ± Comparison against base commit 1d5e841.

♻️ This comment has been updated with latest results.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the MethodWrapper class to improve code organization and maintainability by extracting enum conversion logic into a reusable utility method and streamlining method creation.

  • Extracted ConvertStringToEnum method from MethodWrapper.Static.cs into StringUtils.ConvertParameterStringToEnum for better reusability
  • Removed unnecessary virtual modifiers from MethodWrapper properties (InputSchema, OutputSchema, Description)
  • Refactored if-else statements in factory methods to more concise ternary operators

Reviewed Changes

Copilot reviewed 4 out of 61 changed files in this pull request and generated no comments.

File Description
ReflectorNet/src/Utils/StringUtils.cs Added ConvertParameterStringToEnum utility method for converting string parameters to enum types
ReflectorNet/src/Reflector/MethodWrapper.cs Removed virtual modifiers from properties and updated calls to use the new StringUtils.ConvertParameterStringToEnum method
ReflectorNet/src/Reflector/MethodWrapper.Static.cs Removed ConvertStringToEnum method (moved to StringUtils), refactored factory methods to use ternary operators, and removed unused using System; import

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@IvanMurzak IvanMurzak merged commit 0b90510 into main Nov 11, 2025
2 checks passed
@IvanMurzak IvanMurzak deleted the refactoring/other branch November 11, 2025 04:31
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 this pull request may close these issues.

2 participants