Existential.Net Version History
3.1.1 (21st December 2023)
- Minor but high profile formatting fix to package ReadMe.
3.1.0 (21st December 2023)
New features:
- Added support for .Net 8.0
- By default, if exception filter logging fails, a Trace message (at Error level) will be created instead.
- Added MultiTextWriter, a TextWriter implementation that can write the same string to multiple outputs.
- Added IWriteStrategy, an interface consumed by MultiTextWriter.
- Added extension methods for IEnumerable to safely use a non-generic IEnumerator:
Other Improvements:
- Documentation improvements:
- API documentation reviewed and improved
- Added "exceptions thrown" to documentation throughout
- Updated to DocFX "modern" template
- Migrated test mocks from Moq to NSubstitute
Deprecated:
- Marked redundant method as obsolete. Will be removed in a future version.
TypeExtension.IsInstanceOfType<T>(this T, Type)
- prefer the C#is
operator
- Removed the deprecated serialisation constructor from ArgumentTypeException for .Net 8.0:
ArgumentTypeException(SerializationInfo,StreamingContext
3.0.0 (24th March 2023)
New features:
- Added support for .Net 7.0
- Removed support for .Net Framework 4.6.1. Consider upgrading to 4.6.2 or later.
- Removed support for .Net Core 3.1. Consider upgrading to .Net 6.0 or later.
- Removed support for .Net 5.0. Consider upgrading to .Net 6.0 or later.
- Added extension methods for Maybe<T>:
- Added extension method for IEnumerable<T>:
- Added extension methods for IEnumerable<Maybe<T>>:
- Added extension methods for Exception to support logging in exception filters:
- ShouldBeHandledLog(this Exception, Action<ILogger, Exception>, ILogger, TextWriter? inFallbackWriter = null)
- ShouldBeHandledLog<T1>(this Exception, Action<ILogger, T1, Exception>, ILogger, T1, TextWriter? inFallbackWriter = null)
- ShouldBeHandledLog<T1,T2>(this Exception, Action<ILogger, T1, T2, Exception>, ILogger, T1, T2, TextWriter? inFallbackWriter = null)
- ShouldBeHandledLog<T1,T2,T3>(this Exception, Action<ILogger, T1, T2, T3, Exception>, ILogger, T1, T2, T3, TextWriter? inFallbackWriter = null)
- ShouldBeHandledLog<T1,T2,T3,T4>(this Exception, Action<ILogger, T1, T2, T3, T4, Exception>, ILogger, T1, T2, T3, T4, TextWriter? inFallbackWriter = null)
- ShouldBeHandledLog<T1,T2,T3,T4,T5>(this Exception, Action<ILogger, T1, T2, T3, T4, T5, Exception>, ILogger, T1, T2, T3, T4, T5, TextWriter? inFallbackWriter = null)
- ShouldBeHandledLog<T1,T2,T3,T4,T5,T6>(this Exception, Action<ILogger, T1, T2, T3, T4, T5, T6, Exception>, ILogger, T1, T2, T3, T4, T5, T6, TextWriter? inFallbackWriter = null)
- ShouldBeUnhandledLog(this Exception, Action<ILogger, Exception>, ILogger, TextWriter? inFallbackWriter = null)
- ShouldBeUnhandledLog<T1>(this Exception, Action<ILogger, T1, Exception>, ILogger, T1, TextWriter? inFallbackWriter = null)
- ShouldBeUnhandledLog<T1,T2>(this Exception, Action<ILogger, T1, T2, Exception>, ILogger, T1, T2, TextWriter? inFallbackWriter = null)
- ShouldBeUnhandledLog<T1,T2,T3>(this Exception, Action<ILogger, T1, T2, T3, Exception>, ILogger, T1, T2, T3, TextWriter? inFallbackWriter = null)
- ShouldBeUnhandledLog<T1,T2,T3,T4>(this Exception, Action<ILogger, T1, T2, T3, T4, Exception>, ILogger, T1, T2, T3, T4, TextWriter? inFallbackWriter = null)
- ShouldBeUnhandledLog<T1,T2,T3,T4,T5>(this Exception, Action<ILogger, T1, T2, T3, T4, T5, Exception>, ILogger, T1, T2, T3, T4, T5, TextWriter? inFallbackWriter = null)
- ShouldBeUnhandledLog<T1,T2,T3,T4,T5,T6>(this Exception, Action<ILogger, T1, T2, T3, T4, T5, T6, Exception>, ILogger, T1, T2, T3, T4, T5, T6, TextWriter? inFallbackWriter = null)
- Added extension methods for ILogger to support logging in exception filters:
- LogsThenHandle(this Exception, Action<ILogger, Exception>, TextWriter? inFallbackWriter = null)
- LogsThenHandle<T1>(this ILogger, Exception, Action<ILogger, T1, Exception>, T1, TextWriter? inFallbackWriter = null)
- LogsThenHandle<T1,T2>(this ILogger, Exception, Action<ILogger, T1, T2, Exception>, T1, T2, TextWriter? inFallbackWriter = null)
- LogsThenHandle<T1,T2,T3>(this ILogger, Exception, Action<ILogger, T1, T2, T3, Exception>, T1, T2, T3, TextWriter? inFallbackWriter = null)
- LogsThenHandle<T1,T2,T3,T4>(this ILogger, Exception, Action<ILogger, T1, T2, T3, T4, Exception>, T1, T2, T3, T4, TextWriter? inFallbackWriter = null)
- LogsThenHandle<T1,T2,T3,T4,T5>(this ILogger, Exception, Action<ILogger, T1, T2, T3, T4, T5, Exception>, T1, T2, T3, T4, T5, TextWriter? inFallbackWriter = null)
- LogsThenHandle<T1,T2,T3,T4,T5,T6>(this ILogger, Exception, Action<ILogger, T1, T2, T3, T4, T5, T6, Exception>, T1, T2, T3, T4, T5, T6, TextWriter? inFallbackWriter = null)
- LogsThenRethrow(this ILogger, Exception, Action<ILogger, Exception>, TextWriter? inFallbackWriter = null)
- LogsThenRethrow<T1>(this ILogger, Exception, Action<ILogger, T1, Exception>, T1, TextWriter? inFallbackWriter = null)
- LogsThenRethrow<T1,T2>(this ILogger, Exception, Action<ILogger, T1, T2, Exception>, T1, T2, TextWriter? inFallbackWriter = null)
- LogsThenRethrow<T1,T2,T3>(this ILogger, Exception, Action<ILogger, T1, T2, T3, Exception>, T1, T2, T3, TextWriter? inFallbackWriter = null)
- LogsThenRethrow<T1,T2,T3,T4>(this ILogger, Exception, Action<ILogger, T1, T2, T3, T4, Exception>, T1, T2, T3, T4, TextWriter? inFallbackWriter = null)
- LogsThenRethrow<T1,T2,T3,T4,T5>(this ILogger, Exception, Action<ILogger, T1, T2, T3, T4, T5, Exception>, T1, T2, T3, T4, T5, TextWriter? inFallbackWriter = null)
- LogsThenRethrow<T1,T2,T3,T4,T5,T6>(this ILogger, Exception, Action<ILogger, T1, T2, T3, T4, T5, T6, Exception>, T1, T2, T3, T4, T5, T6, TextWriter? inFallbackWriter = null)
Bug fixes:
- For an empty Maybe<T>, where T was a value type, the method
TryGetValue(out T)
would incorrectly return
true
and populate the out value withdefault(T)
.
2.0.0 (21st April 2022)
Breaking changes:
- Creating a Maybe<T> has been simplified, with superfluous creation methods removed.
- Removed the following obsolete methods:
GetGenericEnumerable.From<T>(IEnumerable)
Maybe.Some<T>(T?)
Maybe.Some<T>(Maybe<T>)
Maybe<T>.op_Implicit(T)
Maybe<T>.Or(Maybe<T>)
Maybe<T>.Or(Func<Maybe<T>>)
Maybe<T>.WithValue(T?)
Maybe<T>.WithValue(Maybe<T>)
Maybe<T>.WithKnownValue(T)
Maybe<T>.WithGuaranteedValue(T)
New features:
- Added Maybe<T>-supporting extension methods for IEnumerable<T>:
1.4.0 (5th April 2022)
- Added support for nullable reference types
- Added GetGenericEnumerable<T> - improved syntax for creation of generic enumerables
- Added more expressive static creation methods to Maybe:
- WithValue<T>(T) This is now the recommended method for constructing Maybes.
- WithValue<T>(Maybe<T>)
- WithKnownValue<T>(T)
- ...and to Maybe<T>:
WithValue(Maybe<T>)
- Marked older, less expressive methods as obsolete in favour of the more expressively named alternatives:
Maybe.Some<T>(T)
- prefer WithValue<T>(T).Maybe.Some<T>(Maybe<T>)
- prefer WithValue(Maybe<T>).
1.3.1 (12th November 2021)
- Added support for .NET 6.0
- Updated recommended .editorconfig string for null-check validation methods
1.3.0 (8th October 2021)
- Added optional MIT licence.
- Added methods to Validate:
- Added Negate() extension method for System.Predicate.
- Improved exception messages thrown for
ThrowIfLessThan
/ThrowIfGreaterThan
Validate methods.
1.2.1 (15th March 2021)
- Removed unnecessary package dependencies included in version 1.2.0.
1.2.0 (14th March 2021)
- Multi-targeting introduced to add improved support for .NET 5.0 and later:
- Cryptographically random generation of hash codes introduced for HashCodeHelper, for greater security.
- Marked redundant methods as obsolete in favour of more expressively named alternatives:
Maybe<T>.WithGuaranteedValue(T)
- preferWithKnownValue(T)
.Maybe<T>.Or(Maybe<T>)
- prefer GetValueOrMaybe(Maybe<T>)Maybe<T>.Or(Func<Maybe<T>>)
- prefer GetValueOrMaybe(Func<Maybe<T>>)
1.1.0 (29th November 2020)
- Established feature parity with Java's
Optional<T>. Added:
Maybe<T>.WithValue(T)
,- Maybe<T>.IfExists(Action<T>).
Maybe<T>.WithGuaranteedValueOf(T)
(now obsolete),Maybe<T>.Or(Maybe<T>)
(now obsolete),Maybe<T>.Or(Func<Maybe<T>>
) (now obsolete)
- Modified HashCodeHelper behaviour to ensure different results in different processes (in line with .NET Core default behaviour).
- Added new comparators to the Validate class:
- Made
EnumerableOf
internal, to restrict it to an implementation role.
1.0.0 (26th October 2020)
- Initial release as a .NET Standard 2.0 assembly under MS-PL licence.
- Support for:
- .NET Frameworks 4.61 to 4.8
- .NET Core 2.0 to 3.1
- .NET 5.0