What is Cadru?
Cadru is a collection of NuGet packages containing new APIs and extensions to the core .NET Framework to help complete your developer toolbox. It is designed to be cross-platform and targets .NET Standard 2.1.
What's in it?
Cadru is made up of the following packages:
Provides ASP.NET Core middleware and other extensions for request and/response logging.
Provides additional support for working with ASP.NET Core, such as custom view location expanders, support for IMetadataAware, and rendering enumerated types as SelectLists based on a UiHint attribute, and extensions to make working with state management a bit simpler.
Provides additional ASP.NET Core TagHelpers.
Provides additional MSBuild tasks and is used to support assembly-build-versioning.
Provides a standard implementation for creating and using cache keys.
Provides additional collection classes and extensions.
Provides static classes for representing program contracts as preconditions in a way that's compatible with System.Diagnostics.Contracts.
Provides common extensions and new APIs for the .NET Framework.
Provides a standard way to read Excel data and fixed width files.
Provides common data annotation attributes.
Provides a common database context and predicates for use with Dapper.
Provides support for determining framework versions, IIS version, and feature detection.
Additional file providers and support for working with physical files and directories.
Provides transient error detection strategies for adding retry logic into your HttpClient calls and a UrlBuilder to help simplify building complex URLs.
Provides access to network information and notification of network status changes.
Provides support for working with Polly policies, including a strategy for resilient database queries.
Provides classes for generating email using ASP.NET MVC Razor views.
Support for creating System for Cross-domain Identity Management (SCIM) filters.
Provides additional assert capabilities for MS Test.
The following packages have been retired. They are still available on NuGet, but shouldn't be used.
- Cadru.TransientFaultHandling - This package has been retired and should be replaced with *Cadru.Polly.
- Cadru.Net - This package is renamed to *Cadru.Net.Http
- Cadru.Core.Windows - This package is retired, and features migrated to Cadru.Environment, Cadru.IO, and Cadru.Net.NetworkInformation as appropriate.
- Cadru.IO - This package will eventually be retired and replaced with Cadru.Extensions.FileProviders.
What's next for Cadru?
The most significant update planned will be support for .NET 5 when it releases in November. Until then, there are a handful of known tasks still left. See the Cadru 5.0 milestone for more details. There are only a few issues in there right now, but I will be adding more over time.
Why another library?
Although Cadru was released as an open source framework in July 2013, some of the APIs it contains were created as early as 2003 and have been used in a variety of real world solutions. These are things that I kept having to rewrite in the apps I was building. Rather than continuing to rewrite them, I decided to encapsulate them in a library and make it broadly available. Although Cadru grew from app development, I have rewritten everything with a focus on being an API rather than a jumbled collection of utilities. That means everything is (hopefully) well documented, cleanly written, and easy to use.
There are also a lot of unit tests that show how to use the APIs which can be a good starting place as well. (My goal is to as be as close to 100% code coverage as possible. Obviously, that will always be a work in progress.)
The long-term goal is to put the documentation online somewhere (probably as wiki pages hosted in the repository), but I don't have a time frame for when that will be complete. Until then, the source code is fully commented using XML documentation comments to provide IntelliSense support in Visual Studio.
Bugs and feature requests
You can also get involved and fork the repository to submit your own pull requests. (More detailed contributor guidelines will be available soon.)
For transparency and to maintain backward compatibility (as much as possible), Cadru uses the Semantic Versioning guidelines.
Copyright and license
Code and documentation copyright 2001-2020 Scott Dorman. Code is licensed under the Microsoft Public License, use it as you wish (but please provide some credit somewhere in your app.) Documentation is released under Creative Commons.