SafeTypes Utilities is a collection of tools and utilities designed to enhance type safety in your projects. With this library, you can reduce runtime errors by leveraging compile-time type checks and ensuring stricter contracts within your codebase.
- Enhanced Type Safety: Focus on preventing common programming bugs caused by incompatible types.
- Extensibility: Easily extend and adapt to your specific application needs.
- Seamless Integration: Works out-of-the-box with .NET Core (net8.0) and higher.
Start by installing the package via NuGet:
dotnet add package JAAvila.SafeTypesIntegrate the library into your project to start leveraging its type-safe utilities.
- Framework: .NET 8.0 or higher
- Language: C# 12 or newer
Note: The library takes full advantage of modern C# features, so make sure your project matches the minimum requirements mentioned above.
-
Add the package to your project using the command:
dotnet add package JAAvila.SafeTypes
-
Import the library into your code:
using JAAvila.SafeTypes;
-
Start coding with added type-safe reliability!
Here’s a basic example to illustrate how you can use this utility:
using SafeTypes.SafeTypes.Extension;
IEnumerable<int>? source = null;
var result = source.SafeNull().ToList();
// Use the type-safe instance as neededMore detailed examples can be found in the documentation (soon).
Contributions are welcome! If you’d like to contribute, please fork this repository, create a new branch, and submit a pull request with your changes.
Before contributing, make sure to review the code of conduct and guidelines for contributions.
This project is licensed under the Apache License 2.0. See the LICENSE file for details.