Update all README examples to use KeywordOptionConfigurator API#6
Merged
Update all README examples to use KeywordOptionConfigurator API#6
Conversation
Co-authored-by: fengb3 <45181245+fengb3@users.noreply.github.com>
Co-authored-by: fengb3 <45181245+fengb3@users.noreply.github.com>
Co-authored-by: fengb3 <45181245+fengb3@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update README to include new API examples
Update README with KeywordOptionConfigurator API examples
Dec 18, 2025
Owner
|
@copilot 我希望所有可以用到 新 api 的地方都使用 KeywordOptionConfigurator 作为示例 |
… applicable Co-authored-by: fengb3 <45181245+fengb3@users.noreply.github.com>
Contributor
Author
Done! I've updated all README examples to use the KeywordOptionConfigurator API wherever applicable: ✅ Using Constructors - Now uses All 7 README examples now verified with passing tests. Commit: 3604733 |
Co-authored-by: fengb3 <45181245+fengb3@users.noreply.github.com>
Copilot
AI
changed the title
Update README with KeywordOptionConfigurator API examples
Update all README examples to use KeywordOptionConfigurator API
Dec 18, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The new
KeywordOptionConfiguratorAPI provides a fluent syntax for specifying access modifiers. The README showed the legacy.WithKeyword("public")approach in several examples.Changes
Updated all code examples to use fluent keyword API wherever applicable:
ns.Public.Class()instead ofns.Class()+cls.WithKeyword("public")cls.Public.AutoProperty()instead ofp.WithKeyword("public")cls.Public.Method()instead ofmethod.WithKeyword("public")Updated sections:
ns.Public.Class()andcls.Public.AutoProperty()ns.Public.Class()andcls.Public.Method()classOption.WithKeyword("public")for TypeOption andclassOption.Public.AutoProperty()for propertiesclassOption.Public.Method()within a class contextclassOption.Public.Method()within a class contextAdded "Using Keyword Configurator" section demonstrating:
new NamespaceOption().WithName("X").Public.Class(...)Code.Create().Class(cls => cls.Public.AutoProperty(...))using Fengb3.EasyCodeBuilder.Csharp.OptionConfigurations;Updated Extension Methods documentation to include
Public,Private,Internal,Staticproperties andKeywordConfiguratorfor advanced chainingExample
Before:
After:
Testing
Comprehensive verification tests added for all 7 README examples to ensure they compile and produce expected output. All tests pass successfully.
Note: Some examples still use
.WithKeyword()where KeywordConfigurator support doesn't exist yet (e.g., Constructor doesn't have aPublic.Constructor()extension method).Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.