Code Extensions
Powerful C# extension methods for validation, conversion, and string manipulation
What are Code Extensions?
Code Extensions is a comprehensive library of C# extension methods that simplify common programming tasks. With over 50 extension methods, it provides powerful utilities for validation, type conversion, and string manipulation, reducing boilerplate code and improving readability.
Key Features
- Type validation extensions (IsInt32, IsDecimal, IsGuid, etc.)
- Type conversion extensions (ToInt, ToDecimal, ToDateTime, etc.)
- String manipulation helpers (IsNullOrEmpty, IsNullOrWhiteSpace)
- Date range validation (IsBetween)
- Collection helpers (In<T>, IsNullOrEmpty for IEnumerable)
- Numeric range validation (IsIntGreaterThan, IsIntGreaterThanAndLessThan)
- Null-safe operations throughout
- Compatible with .NET 6, 8, and 10
📦 Install via NuGet
After installation, import the namespace using CodeExtensions; and all extension
methods become available on their respective types. No additional configuration required!
Good news! Most of these extension methods are already included in DatabaseLibraryMDS and DatabaseLibrarySDS. If you're using either of those packages, you already have access to these validation and conversion utilities without needing to install CodeExtensions separately.
💡 Only install CodeExtensions if you need these utilities standalone, without the full Database Library functionality.
Explore the Validations and Conversions tabs to see the complete list of available extension methods and their usage.