Skip to content

Commit 9cd67b0

Browse files
authored
Merge pull request #5 from BigBadJock/upgrade-to-NET10
Upgrade to net10
2 parents b82cee4 + 106a0b8 commit 9cd67b0

File tree

11 files changed

+2241
-15
lines changed

11 files changed

+2241
-15
lines changed

.github/copilot-instructions.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# SilverCodeAPI - Copilot Instructions
2+
3+
## Project Overview
4+
This is a .NET 9 API solution providing common infrastructure for data access patterns, including repository pattern and unit of work implementations.
5+
6+
## Technology Stack
7+
- **Target Framework**: .NET 9
8+
- **Language**: C#
9+
- **Architecture**: Repository pattern with data services
10+
- **Key Components**:
11+
- Core.Common: Base implementations for repositories and data services
12+
- Core.Common.Contracts: Interfaces and contracts
13+
- Core.Common.DataModels: Data models and entities
14+
15+
## Coding Standards
16+
17+
### General Guidelines
18+
- Follow C# naming conventions (PascalCase for public members, camelCase for private fields)
19+
- Use nullable reference types appropriately
20+
- Prefer async/await for I/O operations
21+
- Keep methods focused and single-purpose
22+
23+
### Architecture Patterns
24+
- **Repository Pattern**: Use generic repository base classes (BaseRepository, BaseRepositoryWithIntId, BaseRepositoryWithGuidId, BaseRepositoryWithStringId)
25+
- **Data Service Pattern**: Implement data services using BaseDataService and its variants
26+
- **Unit of Work**: Use IUnitOfWork for transaction management
27+
- **Database Factory**: Use IDatabaseFactory for database context creation
28+
29+
### Code Organization
30+
- Interfaces go in Core.Common.Contracts
31+
- Base implementations go in Core.Common
32+
- Use generic type constraints for ID types (int, Guid, string)
33+
- Separate read operations (IReadRepository) from write operations (IRepository)
34+
35+
### Dependency Injection
36+
- Design all services and repositories for dependency injection
37+
- Use constructor injection
38+
- Register services with appropriate lifetimes
39+
40+
### Error Handling
41+
- Use appropriate exception types
42+
- Include meaningful error messages
43+
- Consider adding try-catch blocks for external dependencies
44+
45+
### Testing
46+
- Write unit tests for business logic
47+
- Consider integration tests for repository implementations
48+
- Mock dependencies appropriately
49+
50+
### Documentation
51+
- Add XML documentation comments for public APIs
52+
- Document complex logic with inline comments
53+
- Keep README files updated
54+
55+
## Project-Specific Rules
56+
- When creating new repositories, inherit from appropriate base classes
57+
- When creating new data services, inherit from BaseDataService variants
58+
- Maintain consistency with existing ID type patterns (int, Guid, string)
59+
- Follow the established separation between contracts and implementations
60+
- Use IAuditor for audit logging when applicable
61+
62+
## File Naming
63+
- Interface files: I{Name}.cs (e.g., IRepository.cs)
64+
- Base class files: Base{Name}.cs (e.g., BaseRepository.cs)
65+
- Keep file names consistent with the class names they contain
66+
67+
## Common Tasks
68+
- **Adding a new repository**: Inherit from BaseRepository or its typed variants, implement required interfaces
69+
- **Adding a new data service**: Inherit from BaseDataService or its typed variants
70+
- **Adding new contracts**: Place interfaces in Core.Common.Contracts project
71+
- **Extending functionality**: Consider adding to base classes when logic is reusable across multiple implementations
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Issue ID,Description,State,Severity,Story Points,Project Path,Location Kind,Path,Line,Column,Incident ID,Help Link,Assembly Name,Assembly Version,Assembly Public Key,Snippet
2+
NuGet.0002,NuGet package upgrade is recommended,Active,Potential,1,Core.Common.Contracts\Core.Common.Contracts.csproj,File,Core.Common.Contracts\Core.Common.Contracts.csproj,,,Microsoft.EntityFrameworkCore 9.0.1,,,,,"Microsoft.EntityFrameworkCore, 9.0.1 Recommendation: Remove Microsoft.EntityFrameworkCore, and replace with new package Microsoft.EntityFrameworkCore 10.0.5"
3+
Project.0002,Project's target framework(s) needs to be changed,Active,Mandatory,1,Core.Common.Contracts\Core.Common.Contracts.csproj,File,Core.Common.Contracts\Core.Common.Contracts.csproj,,,,,,,,Current target framework: net9.0 Recommended target framework: net10.0
4+
NuGet.0002,NuGet package upgrade is recommended,Active,Potential,1,Core.Common\Core.Common.csproj,File,Core.Common\Core.Common.csproj,,,Microsoft.EntityFrameworkCore 9.0.1,,,,,"Microsoft.EntityFrameworkCore, 9.0.1 Recommendation: Remove Microsoft.EntityFrameworkCore, and replace with new package Microsoft.EntityFrameworkCore 10.0.5"
5+
NuGet.0002,NuGet package upgrade is recommended,Active,Potential,1,Core.Common\Core.Common.csproj,File,Core.Common\Core.Common.csproj,,,Newtonsoft.Json 13.0.3,,,,,"Newtonsoft.Json, 13.0.3 Recommendation: Remove Newtonsoft.Json, and replace with new package Newtonsoft.Json 13.0.4"
6+
NuGet.0004,NuGet package contains security vulnerability,Active,Optional,1,Core.Common\Core.Common.csproj,File,Core.Common\Core.Common.csproj,,,Microsoft.AspNetCore.Identity 2.3.0,,,,,"Microsoft.AspNetCore.Identity, 2.3.0 Recommendation: Microsoft.AspNetCore.Identity, 2.3.9"
7+
Project.0002,Project's target framework(s) needs to be changed,Active,Mandatory,1,Core.Common\Core.Common.csproj,File,Core.Common\Core.Common.csproj,,,,,,,,Current target framework: net9.0 Recommended target framework: net10.0
8+
NuGet.0002,NuGet package upgrade is recommended,Active,Potential,1,Core.Common.DataModels\Core.Common.DataModels.csproj,File,Core.Common.DataModels\Core.Common.DataModels.csproj,,,Microsoft.AspNetCore.Identity.EntityFrameworkCore 9.0.1,,,,,"Microsoft.AspNetCore.Identity.EntityFrameworkCore, 9.0.1 Recommendation: Remove Microsoft.AspNetCore.Identity.EntityFrameworkCore, and replace with new package Microsoft.AspNetCore.Identity.EntityFrameworkCore 10.0.5"
9+
Project.0002,Project's target framework(s) needs to be changed,Active,Mandatory,1,Core.Common.DataModels\Core.Common.DataModels.csproj,File,Core.Common.DataModels\Core.Common.DataModels.csproj,,,,,,,,Current target framework: net9.0 Recommended target framework: net10.0

0 commit comments

Comments
 (0)