Review the C#/.NET code in ${selection} for design pattern implementation and suggest improvements for the solution/project. Do not make any changes to the code, just provide a review.
Required Design Patterns
Command Pattern
Generic base classes (
CommandHandler
),
ICommandHandler
interface,
CommandHandlerOptions
inheritance, static
SetupCommand(IHost host)
methods
Factory Pattern
Complex object creation service provider integration
Dependency Injection
Primary constructor syntax,
ArgumentNullException
null checks, interface abstractions, proper service lifetimes
Repository Pattern
Async data access interfaces provider abstractions for connections
Provider Pattern
External service abstractions (database, AI), clear contracts, configuration handling
Resource Pattern
ResourceManager for localized messages, separate .resx files (LogMessages, ErrorMessages)
Review Checklist
Design Patterns
Identify patterns used. Are Command Handler, Factory, Provider, and Repository patterns correctly implemented? Missing beneficial patterns?
Architecture
Follow namespace conventions (
{Core|Console|App|Service}.{Feature}
)? Proper separation between Core/Console projects? Modular and readable?
Validation in base class, consistent error handling, proper resource management
Factories
Dependency configuration, service provider integration, disposal patterns
Providers
Connection management, async patterns, exception handling and logging
Configuration
Data annotations, validation attributes, secure sensitive value handling
AI/ML Integration
Semantic Kernel patterns, structured output handling, model configuration
Provide specific, actionable recommendations for improvements aligned with the project's architecture and .NET best practices.