How shahdfares/elamalfurniture works
ElAmal is a product-catalog API. A client requests categories or filtered/product-detail data; controllers delegate to application services, which query repositories and return mapped DTOs. Product listing applies specifications and pagination, while persistence is backed by an EF Core context. The graph also retains category handling, catalog relationships, and startup-registered database initialization. Evidence is strongest for the excerpted controllers, services, mapping, context, and registration; unexcerpted runtime wiring is omitted where the source index does not establish a relationship.
Main entry points: ProductServices.cs Product queries · MappingProfile.cs DTO mapping · ElAmalDbContext.cs EF Core context · ApplicationServicesExtension.cs Service registration
Components 25
HTTP API
- Product endpoints
ElAmal/Controllers/ProductController.cs - Category endpoints
ElAmal/Controllers/CategoryController.cs - API responses
ElAmal.Shared/Errors/ApiResponse.cs - Exception handling
ElAmal.Shared/Middleware/ExeptionMiddleware.cs
Application Services
- Product queries
ElAmal.Application/Services/products/ProductServices.cs - Category queries
ElAmal.Application/Services/Category/CategoryServices.cs - DTO mapping
ElAmal.Core/Helper/MappingProfile.cs - Product service contract
ElAmal.Core/Contract/Services/Products/IProductServices.cs - Category service contract
ElAmal.Core/Contract/Services/Category/ICategoryServices.cs - Service registration
ElAmal/Extensions/ApplicationServicesExtension.cs
Catalog Domain
- Product specifications
ElAmal.Core/Specifications/ProductSpecs/ProductWithCategorySpecification.cs - Filter parameters
ElAmal.Core/Specifications/ProductSpecs/ProductSpecParams.cs - Paginated results
ElAmal.Core/Helper/Pagenation.cs - Product entity
ElAmal.Core/Entities/Products/Product.cs - Category entity
ElAmal.Core/Entities/Products/Category/ProductCategory.cs - Product images
ElAmal.Core/Entities/Products/Images/ProductImages.cs - Technical specifications
ElAmal.Core/Entities/Products/TechnicalSpecifications/ProductTechnicalSpecification.cs - Product response DTO
ElAmal.Shared/DTOs/Product/ProductToReturnDto.cs - Category response DTO
ElAmal.Shared/DTOs/Category/CategoryResponseDto.cs
Persistence
- Unit of work
ElAmal.Infrastructure/Data/UnitOfWork.cs - Generic repository
ElAmal.Infrastructure/Data/Repository/GenericRepository.cs - EF Core context
ElAmal.Infrastructure/Data/ElAmalDbContext.cs - Catalog database
- Context initializer
ElAmal.Infrastructure/Data/ElAmalContextInitializer.cs
Other components
- API client
Connections 35
- API client → Product endpoints: requests
- API client → Category endpoints: requests
- Product endpoints → Product queries: delegates
ElAmal/Controllers/ProductController.cs - Category endpoints → Category queries: delegates
ElAmal/Controllers/CategoryController.cs - Product endpoints → API responses: returns errors
ElAmal/Controllers/ProductController.cs - Category endpoints → API responses: returns errors
ElAmal/Controllers/CategoryController.cs - Product queries → Product specifications: builds queries
ElAmal.Application/Services/products/ProductServices.cs - Product queries → Filter parameters: uses filters
ElAmal.Application/Services/products/ProductServices.cs - Product queries → Unit of work: queries repositories
ElAmal.Application/Services/products/ProductServices.cs - Product queries → DTO mapping: maps results
ElAmal.Application/Services/products/ProductServices.cs - Product queries → Paginated results: returns page
ElAmal.Application/Services/products/ProductServices.cs - Category queries → Unit of work: queries repository
ElAmal.Application/Services/Category/CategoryServices.cs - Category queries → DTO mapping: maps results
ElAmal.Application/Services/Category/CategoryServices.cs - DTO mapping → Product entity: maps from
ElAmal.Core/Helper/MappingProfile.cs - DTO mapping → Category entity: maps from
ElAmal.Core/Helper/MappingProfile.cs - DTO mapping → Product images: maps from
ElAmal.Core/Helper/MappingProfile.cs - DTO mapping → Technical specifications: maps from
ElAmal.Core/Helper/MappingProfile.cs - DTO mapping → Product response DTO: maps to
ElAmal.Core/Helper/MappingProfile.cs - DTO mapping → Category response DTO: maps to
ElAmal.Core/Helper/MappingProfile.cs - Product endpoints → Product service contract: depends on
ElAmal/Controllers/ProductController.cs - Category endpoints → Category service contract: depends on
ElAmal/Controllers/CategoryController.cs - Product queries → Product service contract: implements
ElAmal.Application/Services/products/ProductServices.cs - Category queries → Category service contract: implements
ElAmal.Application/Services/Category/CategoryServices.cs - Unit of work → Generic repository: provides repositories
- Generic repository → EF Core context: queries
ElAmal.Infrastructure/Data/Repository/GenericRepository.cs - EF Core context → Catalog database: reads and writes
- EF Core context → Product entity: models
ElAmal.Infrastructure/Data/ElAmalDbContext.cs - EF Core context → Category entity: models
ElAmal.Infrastructure/Data/ElAmalDbContext.cs - EF Core context → Product images: models
ElAmal.Infrastructure/Data/ElAmalDbContext.cs - EF Core context → Technical specifications: models
ElAmal.Infrastructure/Data/ElAmalDbContext.cs - Service registration → EF Core context: registers
ElAmal/Extensions/ApplicationServicesExtension.cs - Service registration → Unit of work: registers
ElAmal/Extensions/ApplicationServicesExtension.cs - Service registration → Context initializer: registers
ElAmal/Extensions/ApplicationServicesExtension.cs - Service registration → Product queries: registers
ElAmal/Extensions/ApplicationServicesExtension.cs - Service registration → Category queries: registers
ElAmal/Extensions/ApplicationServicesExtension.cs