- Overview
- Versioning Notice
- Quick Start
- Features
- Development Setup
- Supported Frameworks
- Contributing
- Authors
- License
- Acknowledgments
Easy Core is a .NET utility library that provides reusable components for common application development tasks. It includes extension methods, security services, validation attributes, converters, and utility helpers to simplify and accelerate modern .NET application development.
As of version 10.0.0, Easy Core uses a versioning scheme aligned with the .NET major version it targets:
-
Easy Core 10.x.x includes a .NET 10.x target (and multi-targets .NET 8/9 for compatibility)
-
Major version = .NET major version
-
Minor and patch versions for library-specific updates
Install via NuGet:
dotnet add package Easy.Base
Or manually add to your .csproj file:
<ItemGroup>
<PackageReference Include="Easy.Base" Version="10.0.*" />
</ItemGroup>String Extensions:
using easy_core;
var encoded = "Hello".Base64Encode(); // Encode to Base64
var decoded = encoded.Base64Decode(); // Decode from Base64
var csv = "Hello, World".ToCsvString(); // Format for CSVCollection Extensions:
var numbers = new[] { 1, 2, 3, 4, 5 };
if (numbers.IsNullOrEmpty() == false)
if (numbers.IsNotNullOrEmpty())
{
// Use collection
}
// LINQ operations
var filtered = numbers.ExceptBy(new[] { 2, 4 }, x => x);Encryption & Hashing:
// Encrypt sensitive data
var key = EncryptionService.NewKey();
var encrypted = EncryptionService.Encrypt("sensitive", key);
var decrypted = EncryptionService.Decrypt(encrypted, key);
// Hash passwords
var hash = HashingService.CreateHash("password");
var isValid = HashingService.VerifyHash("password", hash);OTP Generation:
// Generate time-based one-time passwords for 2FA
var secret = OtpService.GenerateSecret();
var otp = OtpService.GenerateOtp(secret);Convenient extension methods for common operations:
- String Extensions - Base64 encoding/decoding, CSV formatting, string manipulation
- Collection Extensions - LINQ operations, null checking, filtering helpers
- Date & Time Extensions - Date calculations, time zone handling, ISO week operations
- Enum Extensions - Flag checking, enum value retrieval with attributes
- IP Address Extensions - IP range calculations, address parsing
- Stream Extensions - Stream reading and copying utilities
- Attribute Extensions - Reflection-based attribute value retrieval
Cryptography and security utilities:
- EncryptionService - AES encryption/decryption with configurable settings
- HashingService - PBKDF2 password hashing with salt and iteration support
- OtpService - Time-based one-time password (TOTP) generation and validation
- CertificateBuilder - SSL certificate generation and validation
Helper classes for common operations:
- MimeTypeMap - Comprehensive MIME type lookups from file extensions
- DriveMapper - Drive letter and volume management
- PredicateBuilder - Dynamic LINQ query construction
Custom data validation attributes:
- CompareAgainstAttribute - Compare field values
- GreaterThanAttribute - Numeric comparison validation
- RequiredIfNullAttribute / RequiredIfNotNullAttribute - Conditional field requirements
- LessThanAttribute - Maximum value validation
Type conversion utilities for common scenarios.
- .NET 8.0 SDK or later
- Visual Studio 2022 or Visual Studio Code (with C# extension)
# Clone the repository
git clone https://github.com/NF-Software-Inc/easy-core.git
cd easy-core
# Build the project
dotnet build
# Run tests
dotnet test
# Create NuGet package
dotnet pack --configuration ReleaseEasy-Core/
├── Attributes/ # Custom validation attributes
├── Converters/ # Type conversion utilities
├── Extensions/ # Extension methods for common types
├── Interfaces/ # Service interfaces and abstractions
├── Models/ # Supporting model classes
├── Tools/ # Utility and security service classes
└── Enums/ # Enum definitions
- .NET 8.0
- .NET 9.0
- .NET 10.0
We welcome contributions! To contribute:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- NF Software Inc.
This project is licensed under the MIT License - see the LICENSE file for details
Thank you to:
- Kmg Design for the project icon