Thank you for your interest in contributing to EasilyNET! We welcome contributions from the community. This document provides guidelines and information to help you get started.
- Code of Conduct
- Getting Started
- Development Environment Setup
- Project Structure
- Coding Standards
- Testing
- Submitting Changes
- Reporting Issues
- License
This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to dygood@outlook.com.
- .NET 10 SDK (latest version recommended)
- Git
- Optional: Docker for running services like MongoDB, RabbitMQ, etc.
- Fork the repository on GitHub.
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/EasilyNET.git cd EasilyNET - Add the upstream remote:
git remote add upstream https://github.com/joesdu/EasilyNET.git
- Create a new branch for your changes:
git checkout -b feature/your-feature-name
- Use descriptive branch names (e.g.,
feature/add-new-encryption-method,fix/bug-in-mongo-driver).
-
Ensure you have the latest .NET 10 SDK installed.
-
Restore dependencies:
dotnet restore
-
Build the solution:
dotnet build
-
For testing with external services, start the required containers:
# For MongoDB replica set docker compose -f docker-compose.mongo.rs.yml up -d # For basic services (Garnet, RabbitMQ, Aspire Dashboard) docker compose -f docker-compose.basic.service.yml up -d
The sample application is located in sample/WebApi.Test.Unit/. To run it:
cd sample/WebApi.Test.Unit
dotnet runsrc/: Source code for all packagesEasilyNET.Core/: Core utilities and extensionsEasilyNET.WebCore/: Web API related componentsEasilyNET.AutoDependencyInjection/: Dependency injection frameworkEasilyNET.RabbitBus.AspNetCore/: RabbitMQ message bus for ASP.NET CoreEasilyNET.Mongo.AspNetCore/: MongoDB integration for ASP.NET CoreEasilyNET.Security/: Security and encryption utilities
sample/: Sample applications and usage examplestest/: Unit tests and benchmarksdocs/: Documentation for individual packages
- Follow the existing code style in the project.
- Use meaningful variable and method names.
- Add XML documentation comments for public APIs.
- Keep methods small and focused on a single responsibility.
- Use the latest C# features where appropriate (project targets .NET 10 and C# preview features).
- Prefer
async/awaitfor asynchronous operations. - Use pattern matching and modern language features.
- Follow the Microsoft C# Coding Conventions.
- Use clear, descriptive commit messages.
- Start with a verb (e.g., "Add", "Fix", "Update", "Refactor").
- Keep the first line under 50 characters.
- Add more details in the body if needed.
Example:
Add support for DateOnly and TimeOnly in MongoDB serialization
- Serialize DateOnly as string in ISO format
- Serialize TimeOnly as long (ticks)
- Add unit tests for new serialization logic
Run all tests:
dotnet testRun tests for a specific project:
dotnet test test/EasilyNET.Test.Unit/EasilyNET.Test.Unit.csproj- Write unit tests for new features and bug fixes.
- Use xUnit as the testing framework (follow existing patterns).
- Aim for good test coverage.
- Place tests in the appropriate
test/directory.
For performance-critical code, add benchmarks in test/EasilyNET.Core.Benchmark/.
-
Ensure your code builds and all tests pass:
dotnet build dotnet test -
Update documentation if needed (README files in
src/directories). -
Commit your changes:
git add . git commit -m "Your descriptive commit message"
-
Push to your fork:
git push origin feature/your-feature-name
-
Create a Pull Request:
- Go to the original repository on GitHub.
- Click "New Pull Request".
- Select your branch and provide a clear description of your changes.
- Reference any related issues.
- Provide a clear title and description.
- Include screenshots or examples for UI changes.
- Keep PRs focused on a single feature or fix.
- Ensure CI checks pass.
- Be responsive to feedback and make requested changes.
- Use GitHub Issues to report bugs or request features.
- Provide detailed steps to reproduce bugs.
- Include relevant environment information (.NET version, OS, etc.).
- Check existing issues before creating new ones.
By contributing to this project, you agree that your contributions will be licensed under the same MIT License that covers the project.
Thank you for contributing to EasilyNET! Your efforts help make this project better for everyone.