A small demonstration C# project for testing graphify-dotnet knowledge graph extraction.
This sample demonstrates common architectural patterns that create interesting knowledge graphs:
- Repository Pattern: Generic
IRepository<T>interface with concreteUserRepositoryimplementation - Service Layer:
UserServiceorchestrates business logic and calls the repository - Dependency Injection:
ServiceCollectionExtensionsprovides DI registration methods - Entity Model: Simple
Userentity with validation logic
src/
├── IRepository.cs # Generic repository interface
├── User.cs # User entity model
├── UserRepository.cs # In-memory repository implementation
├── UserService.cs # Service layer with business logic
└── ServiceCollectionExtensions.cs # DI configuration
From the repository root, run:
dotnet run --project src/Graphify.Cli/Graphify.Cli.csproj run samples/mini-libraryThis will:
- Detect all
.csfiles in the sample - Extract entities, methods, and relationships using AST parsing
- Build a knowledge graph showing the repository pattern structure
- Generate multiple export formats (JSON, HTML, report, etc.)
The knowledge graph should reveal:
- Interfaces:
IRepository<T> - Classes:
User,UserRepository,UserService,ServiceCollectionExtensions - Relationships:
UserRepositoryimplementsIRepository<User>UserServicedepends onIRepository<User>ServiceCollectionExtensionsregisters both repository and service- Method calls between service and repository
- Communities: Likely 2-3 communities (data layer, service layer, infrastructure)
- Interface/Implementation: Abstract repository contract with concrete implementation
- Generic Constraints:
IRepository<T> where T : class - Dependency Injection: Constructor injection in
UserService - Extension Methods: Fluent API for service registration
- Async/Await: Task-based async patterns throughout
This is a realistic mini-codebase that mimics production patterns while being small enough to analyze quickly.