From 1db0e9109dd60c1d8f757717baf867fcc0f1591e Mon Sep 17 00:00:00 2001 From: Vitalii Maklai Date: Tue, 2 Jan 2024 17:50:34 -0500 Subject: [PATCH] v0.18.0 (updated Release Notes and ReadMe as necessary) --- README.NuGet.md | 56 ++- src/Omnifactotum.ReleaseNotes.UpTo-v0.6.0.md | 300 +++++++++++++++ src/Omnifactotum.ReleaseNotes.md | 361 +++---------------- src/Omnifactotum.sln | 3 +- 4 files changed, 377 insertions(+), 343 deletions(-) create mode 100644 src/Omnifactotum.ReleaseNotes.UpTo-v0.6.0.md diff --git a/README.NuGet.md b/README.NuGet.md index 777dbc7..782044f 100644 --- a/README.NuGet.md +++ b/README.NuGet.md @@ -9,36 +9,34 @@ - [Complete Release Notes](https://github.com/HarinezumiSama/Omnifactotum/blob/master/src/Omnifactotum.ReleaseNotes.md) - [ReadMe](https://github.com/HarinezumiSama/Omnifactotum/blob/master/README.md) -### Changes in 0.17.0 (since 0.16.0) +### Changes in 0.18.0 (since 0.17.0) -#### Breaking Changes +#### Breaking changes + +- Object Validation + - `NotNullConstraint` is now inherited from `MemberConstraintBase` instead of `NotNullConstraint` + - `NotNullConstraint` is now sealed + - Removed `Omnifactotum.Validation.ObjectValidationResult.GetException(Func<...>, string?)` + - Removed `Omnifactotum.Validation.Constraints.MemberConstraintValidationError.GetDefaultDescription()` + - Removed `Omnifactotum.Validation.Constraints.MemberConstraintValidationError.GetDefaultDescription(MemberConstraintValidationError)` + - Member constraint's constructor can now be non-public #### New features -- Added `OmnifactotumCharExtensions` - - `ToUIString(this char value)` -- Added `OmnifactotumSpanExtensions` - - `ToHexString(this Span bytes, ...)` - - `TransformMultilineString(...)` -- Added `ValueRangeExtensions` - - `Enumerate(...)` - - `ToArray(...)` -- `OmnifactotumReadOnlySpanExtensions` - - Added `TransformMultilineString(...)` -- `OmnifactotumStringExtensions` - - Added `EnsureNotBlank` - - Added `EnsureNotEmpty` - - Added `TransformMultilineString(...)` -- Validation - - Added `NullableValueRangeConstraintBase` constraint - - Added `OptionalEnumValueDefinedConstraint` constraint - - Added `OptionalValueRangeConstraintBase` constraint - -#### Minor updates and fixes - -- Applied `System.Diagnostics.Contracts.PureAttribute`, `Omnifactotum.Annotations.Pure`, and/or `Omnifactotum.Annotations.MustUseReturnValueAttribute` annotations where reasonable -- Applied `Omnifactotum.Annotations.NotNullAttribute` where reasonable -- Fixed/improved XML-documentation in: - - `NullableEnumValueDefinedConstraint` - - `OmnifactotumStringExtensions` -- Minor code style fixes/improvements +- Object Validation + - Implemented support for `ImmutableArray` in member constraints: + - `NotNullConstraint` + - `NotNullConstraint` + - `NotNullOrEmptyCollectionConstraint` + - `NotNullOrEmptyCollectionConstraint` +- `OmnifactotumTypeExtensions` + - Added `GetInterfaceMethodImplementation(this Type, MethodInfo)` + +#### Updates and fixes + +- Object Validation + - Improved/added support for `ImmutableArray`, `IReadOnlyList`, `IList`, `IEnumerable`, and `IList` + - Improved type casting in expressions + - Improved message format of the exception created by `ObjectValidationResult.GetException()` + - Validating early that a member constraint has a parameterless constructor + - Slightly optimized member constraint creation diff --git a/src/Omnifactotum.ReleaseNotes.UpTo-v0.6.0.md b/src/Omnifactotum.ReleaseNotes.UpTo-v0.6.0.md new file mode 100644 index 0000000..b8f211c --- /dev/null +++ b/src/Omnifactotum.ReleaseNotes.UpTo-v0.6.0.md @@ -0,0 +1,300 @@ +### Changes in 0.6.0 (since 0.5.0) + +#### Breaking changes + +- `OmnifactotumArrayExtensions` + - `Initialize()` overloads now return the passed array instead of `void` +- Enforced the `Enum` constraint on the applicable generic types and methods + - `EnumFactotum` methods: + - `GetValue()` + - `GetValue()` + - `GetAllValues()` + - `GetAllFlagValues()` + - `EnumFixedSizeDictionary` class + - `EnumFixedSizeDictionaryDeterminant` class + - `OmnifactotumEnumExtensions` methods: + - `IsAllSet()` + - `IsAnySet()` + - `IsOneOf()` + +#### Deprecations + +- Object validation + - Deprecated `NotNullOrWhiteSpaceStringConstraint` in favor of the newly + added `NotBlankStringConstraint` + +#### New features + +- Types + - Added delegate `Task EventHandlerAsync<>(...)` (excluding .NET Framework 4.0) + - Added `OutFunc<...>` delegates (similar to `System.Func<>`, but having an `out` parameter of the type `TOutput`) + - `OutFunc` + - `OutFunc` + - `OutFunc` + - `OutFunc` + - Added `SemaphoreSlimBasedLock` + - Object validation: + - Added `NotBlankStringConstraint` + - Added `NotNullOrEmptyCollectionConstraint` + - Added `NotNullOrEmptyCollectionConstraint` + - Added `WebUrlConstraint` +- Extension Methods + - Added `EventHandlerAsyncExtensions` (extension methods for `EventHandlerAsync<>`) (excluding .NET Framework 4.0) + - `OmnifactotumArrayExtensions` + - Using Nullable Reference Types (where applicable) + - Added `Initialize(T[], T)` (initializing with a specific constant value) + - Updated `OmnifactotumCollectionExtensions` + - Added `DoForEachAsync` + - Using Nullable Reference Types for all the methods (where applicable). Particularly: + - `GetFastCount` + - `CollectionsEquivalent` + - `CollectionsEqual` + - `FindDuplicates` + - `DisposeCollectionItemsSafely` + - `AvoidNull` + - `ToHashSet` + - `ToUIString` + - Updated `OmnifactotumDateTimeExtensions` + - Added `EnsureKind()`, `EnsureUtc()`, and `EnsureLocal()` methods + - Added `ToFixedStringWithMilliseconds()` method + - Exposed `FixedStringFormat`, `FixedStringWithMillisecondsFormat`, and `PreciseFixedStringFormat` fields + - Updated `OmnifactotumDateTimeOffsetExtensions` + - Added `ToFixedStringWithMilliseconds()` method + - Exposed `FixedStringFormat`, `FixedStringWithMillisecondsFormat`, and `PreciseFixedStringFormat` fields + - Added `OmnifactotumDelegateExtensions` (extension methods for delegates) with method: + - `GetTypedInvocations()` + - Added `OmnifactotumEqualityComparerExtensions` (extension methods for `IEqualityComparer`) with method: + - `GetHashCodeSafely(this IEqualityComparer, ...)` + - Updated `OmnifactotumGenericObjectExtensions`: + - Added `GetObjectReferenceDescription()` + - Added `GetShortObjectReferenceDescription()` + - Added `AsNullable` (`where T : struct`) + - Applied `NotNullIfNotNull` annotation on `EnsureNotNull()` (.NET Standard 2.1+ and .NET 5.0+ only) + - Using Nullable Reference Types (where applicable). Particularly: + - `ToStringSafely()` + - `ToStringSafelyInvariant()` + - `GetHashCodeSafely()` + - `GetTypeSafely()` + - `ToUIString()` + - `ToPropertyString()` + - `IsEqualByContentsTo()` + - `Morph()` + - Added `OmnifactotumHttpStatusCodeExtensions` with method: + - `ToUIString(HttpStatusCode)` + - Added `OmnifactotumNullableDateTimeExtensions` with methods: + - `ToFixedString()` + - `ToFixedStringWithMilliseconds()` + - `ToPreciseFixedString()` + - Added `OmnifactotumNullableDateTimeOffsetExtensions` with methods: + - `ToFixedString()` + - `ToFixedStringWithMilliseconds()` + - `ToPreciseFixedString()` + - Added `OmnifactotumTaskExtensions` with methods (excluding .NET Framework 4.0): + - `AwaitAllAsync(IEnumerable)` + - `AwaitAllAsync(IEnumerable>)` + - `ConfigureAwaitNoCapturedContext(Task)` + - `ConfigureAwaitNoCapturedContext(Task)` + - Added `OmnifactotumValueTaskExtensions` with methods (excluding .NET Framework 4.0): + - `ConfigureAwaitNoCapturedContext(ValueTask)` + - `ConfigureAwaitNoCapturedContext(ValueTask)` + +#### Minor Updates + +- `OmnifactotumArrayExtensions`: Minor optimization in `AvoidNull()` +- `OmnifactotumGenericObjectExtensions` + - `ToStringSafely()` and `ToStringSafelyInvariant()` now never return `null` and instead fall back to `string.Empty` +- `OmnifactotumStringExtensions`: Fixed annotation in `ToUIString()` +- Applied `MethodImplOptions.AggressiveInlining` (and, when possible, `MethodImplOptions.AggressiveOptimization`) to the methods, where reasonable. Affected classes: + - `OmnifactotumGenericObjectExtensions` + - `OmnifactotumCollectionExtensions` + +--- + +### Changes in 0.5.0 (since 0.4.1) + +#### Breaking changes + +- `ReadOnlySet` class: + - `IsReadOnly` property now implements `ICollection.IsReadOnly` **explicitly** +- `IValueContainer` moved from the namespace `Omnifactotum` to `Omnifactotum.Abstractions` + +#### New features + +- Added `ICurrentDateTimeProvider`, `CurrentDateTimeProviderExtensions`, and `LocalComputerCurrentDateTimeProvider` +- Added `IElapsedTimeProvider`, `ElapsedTimeProviderExtensions`, and `StopwatchElapsedTimeProvider` +- The `ReadOnlySet` class now implements `IReadOnlySet` (.NET 5+) +- Added new extension methods for `System.String`: + - `IsWebUri(string)` + - `ToSecureString(string)` + - `WithoutTrailingSlash(string)` + - `WithSingleTrailingSlash(string)` +- Added new extension methods for `System.Uri`: + - `IsWebUri(Uri)` + - `ToUIString(Uri)` + - `WithoutTrailingSlash(Uri)` + - `WithSingleTrailingSlash(Uri)` +- Added new extension methods for `System.Security.SecureString`: + - `IsNullOrEmpty(SecureString)` + - `ToPlainText(SecureString)` +- Added `ContractAnnotation` to `OmnifactotumGenericObjectExtensions.EnsureNotNull` +- Improvements in the `OmnifactotumStringExtensions` class: + - Using Nullable Reference Types (where applicable) + - Added the `ContractAnnotation` annotations (where applicable) + - Added the `AggressiveInlining` flag (where applicable) + - Improved parameter annotations (using `NotNullWhen`, `ItemCanBeNull` etc. where applicable) + - Other minor improvements + +#### Minor Updates + +- Polished the XML documentation +- Minor optimizations in the `Factotum` class: + - Applied `MethodImplOptions.AggressiveInlining` where applicable + - Forwarding `CreateEmptyCompletedTask()` to `Task.CompletedTask` (except for NET 4.0) + - Forwarding `CreateEmptyFaultedTask(Exception)` to `Task.FromException(Exception)` (except for NET 4.0) + +--- + +### Changes in 0.4.1 (since 0.4.0) + +- Added the `Factotum.For.Identity` method (same as `Factotum.Identity`) +- Added `Factotum.For.IdentityMethod` (the cached reference to the `Factotum.For.Identity` method) +- Using the `Deterministic` build option +- Using Portable PDBs +- Using `snupkg` format of the symbol package + +--- + +### Changes in 0.4.0 (since 0.3.0.119) + +#### Major Updates + +- `Omnifactotum` is now the multi-target package for: + - .NET Framework 4.0, 4.6.1, and 4.7.2 + - .NET Standard 2.0 and 2.1 + - .NET 5.0 +- Addressed multi-target compatibility issues in: + - `ColoredConsoleTraceListener` + - `OmnifactotumAssemblyExtensions` + - `OmnifactotumCollectionExtensions` + - `OmnifactotumDictionaryExtensions` + - `OmnifactotumOperationContextExtensions` + - `KeyValuePair` (static helper) + - Omnifactotum's `ReadOnlyDictionary` + - `WinEventLog` +- Added `OmnifactotumKeyValuePair` static helper for facilitating migration from .NET Framework to .NET Standard/Core + +#### Breaking changes + +- `Factotum`: Removed the methods `ToPropertyString` and `AreEqualByContents` in favor of methods `ToPropertyString` and `IsEqualByContentsTo` in `OmnifactotumGenericObjectExtensions` +- `OmnifactotumArrayExtensions`: The method `AsReadOnly()` moved to `OmnifactotumCollectionExtensions` +- `OmnifactotumCustomAttributeProviderExtensions`: Removed the obsolete method `GetCustomAttributes` +- `OmnifactotumGenericObjectExtensions`: Removed the methods `Affirm` and `ComputePredicate` +- `OmnifactotumMathExtensions`: Removed the methods `Sqr(decimal)`, `SqrChecked(float)`, `SqrChecked(double)` since their expected behavior cannot be achieved + +#### New features + +- `OmnifactotumCollectionExtensions`: Added `ToUIString` implementation for collections of strings and collections of nullable value type instances +- `OmnifactotumGenericObjectExtensions`: Implemented `Morph()` overloads for nullable value types (to complement already existing method for the reference types) +- `OmnifactotumNullableBooleanExtensions`: Added an overload of `ToString` accepting value provider delegates +- Added `ReadOnlyItemCollection` (read-only wrapper for `ICollection`) +- Added partial support of Nullable Reference Types: + - `OmnifactotumGenericObjectExtensions.EnsureNotNull` +- Exposed the class `OmnifactotumRepresentationConstants` (formerly `OmnifactotumConstants`) +- Applied `PureAttribute`, `InstantHandleAttribute`, and `NoEnumerationAttribute` annotations in certain appropriate cases + +#### Fixes and improvements + +- Improved documentation +- `KeyedEqualityComparer`: `IEqualityComparer.Equals` and `IEqualityComparer.GetHashCode` now don't throw an exception f an argument is not compatible with the type `T` +- `OmnifactotumAssemblyExtensions` +- `OmnifactotumCollectionHashCodeHelper` (as per the fix in `OmnifactotumHashCodeHelper`) +- `OmnifactotumDateTimeOffsetExtensions` +- `OmnifactotumEnumExtensions`: `GetName`, `GetQualifiedName`, `GetFullName`, `EnsureDefined`, and `IsDefined` +- `OmnifactotumGenericObjectExtensions`: + - `ToUIString()` now uses the invariant culture if the value is `IFormattable` + - Fix in `IsEqualByContentsTo()` for the case of a type with no fields +- `OmnifactotumHashCodeHelper`: Fix in CombineHashCodeValues (for case when the next hash code is zero) +- `OmnifactotumMethodBaseExtensions` +- `OmnifactotumTypeExtensions` +- Updated JetBrains Annotations in `Omnifactotum.Annotations` + +--- + +### Changes in 0.3.0.119 (since 0.3.0.117) +- Omnifactotum: Removed NuGet dependency to the `MSBuildTasks` package since it is only used for development + +--- + +### Changes in 0.3.0.117 (since 0.3.0.114) +- Omnifactotum: `Factotum` and `Factotum.For`: Improved annotations + +--- + +### Changes in 0.3.0.114 (since 0.3.0.101) +- `OmnifactotumAssemblyExtensions`: Improvements +- **BREAKING CHANGE**: `OmnifactotumDisposableExtensions`: `DisposeSafely` now works only for reference and nullable types (2 overloads) +- **BREAKING CHANGE**: `OmnifactotumCollectionExtensions`: `DisposeCollectionItemsSafely` now works only for reference and nullable types (2 overloads) +- **BREAKING CHANGE**: `Factotum`: `DisposeAndNull` now works also for nullable types (besides reference types) +- Introduced the `AsyncFactotum` class with the overloaded methods `ComputeAsync` and `ExecuteAsync` +- Fix in `MemberConstraintBase.CastTo` (and hence in `TypedMemberConstraintBase`) for nullable types +- Improved annotations in Object Validator and related classes +- Minor improvements + +--- + +### Changes in 0.3.0.101 (since 0.3.0.90) +- `KeyedEqualityComparer`: Fixes and improvements +- `KeyedEqualityComparer` static helper class has been introduced +- `Factotum`: `CreateEmptyCompletedTask` and `CreateEmptyFaultedTask` methods have been introduced +- `OmnifactotumGenericObjectExtensions`: `EnsureNotNull` (for nullable) has been introduced +- `IValueContainer` has been introduced for `ValueContainer` and `SyncValueContainer` +- `ValueContainer` and `SyncValueContainer` helper static classes have been introduced +- Improvements and fixes in `OmnifactotumMethodBaseExtensions` and `OmnifactotumTypeExtensions` +- `OmnifactotumStringExtensions`: `TrimSafely`, `TrimStartSafely`, `TrimEndSafely` and `Shorten` methods now never return null + +--- + +### Changes in 0.3.0.90 (since 0.3.0.86) +- **BREAKING CHANGE** `OmnifactotumCustomAttributeProviderExtensions`: `GetCustomAttributes` has been renamed to `GetCustomAttributeArray` (for compatibility with FW 4.5+) + +--- + +### Changes in 0.3.0.86 (since 0.3.0.83) +- **BREAKING CHANGE** `OmnifactotumDictionaryExtensions`: The method `GetValueOrCreate` has been renamed to `GetOrCreateValue` for readability and in order to avoid confusion with `GetValueOrDefault` +- `OmnifactotumDictionaryExtensions`: Improved annotations +- `ValueContainer` and `SyncValueContainer`: + - Support for equality comparison + - Added `DebuggerDisplay` attribute and `ToString()` method +- `OmnifactotumMathExtensions` class has been introduced: + - `Sqr` (square) + - `Sqrt` (square root) + - `Abs` (absolute value) + +--- + +### Changes in 0.3.0.83 (since 0.3.0.82) +- `FixedSizeDictionary`: Improved annotations +- `FixedSizeDictionary`: Implemented version verification in the enumerator + +--- + +### Changes in 0.3.0.82 (since 0.3.0.80) +- `FixedSizeDictionary`: Removed index verification in the internal determinant since this verification highly affected performance + +--- + +### Changes in 0.3.0.80 (since 0.3.0.79) +- `EnumFixedSizeDictionary`: Fix in determining the size + +--- + +### Changes in 0.3.0.79 (since 0.3.0.74) +- `FixedSizeDictionary` and `EnumFixedSizeDictionary` have been introduced. +- Applied Omnifactotum Annotations to the `Factotum` and `OmnifactotumGenericObjectExtensions` classes. + +--- + +### Changes in 0.3.0.74 (since 0.2.0.59) +- **BREAKING CHANGE** Object Validation: Redesign and support of `IEnumerable`. +- **BREAKING CHANGE** Renamed `EnumHelper` to `EnumFactotum`. +- **BREAKING CHANGE** `OmnifactotumExpressionExtensions` is now in the namespace `System.Linq.Expressions` (instead of System). diff --git a/src/Omnifactotum.ReleaseNotes.md b/src/Omnifactotum.ReleaseNotes.md index ae2bebc..51936a6 100644 --- a/src/Omnifactotum.ReleaseNotes.md +++ b/src/Omnifactotum.ReleaseNotes.md @@ -1,6 +1,38 @@ -### Changes in 0.17.0 (since 0.16.0) +### Changes in 0.18.0 (since 0.17.0) -#### Breaking Changes +#### Breaking changes + +- Object Validation + - `NotNullConstraint` is now inherited from `MemberConstraintBase` instead of `NotNullConstraint` + - `NotNullConstraint` is now sealed + - Removed `Omnifactotum.Validation.ObjectValidationResult.GetException(Func<...>, string?)` + - Removed `Omnifactotum.Validation.Constraints.MemberConstraintValidationError.GetDefaultDescription()` + - Removed `Omnifactotum.Validation.Constraints.MemberConstraintValidationError.GetDefaultDescription(MemberConstraintValidationError)` + - Member constraint's constructor can now be non-public + +#### New features + +- Object Validation + - Implemented support for `ImmutableArray` in member constraints: + - `NotNullConstraint` + - `NotNullConstraint` + - `NotNullOrEmptyCollectionConstraint` + - `NotNullOrEmptyCollectionConstraint` +- `OmnifactotumTypeExtensions` + - Added `GetInterfaceMethodImplementation(this Type, MethodInfo)` + +#### Updates and fixes + +- Object Validation + - Improved/added support for `ImmutableArray`, `IReadOnlyList`, `IList`, `IEnumerable`, and `IList` + - Improved type casting in expressions + - Improved message format of the exception created by `ObjectValidationResult.GetException()` + - Validating early that a member constraint has a parameterless constructor + - Slightly optimized member constraint creation + +--- + +### Changes in 0.17.0 (since 0.16.0) #### New features @@ -32,9 +64,11 @@ - `OmnifactotumStringExtensions` - Minor code style fixes/improvements +--- + ### Changes in 0.16.0 (since 0.15.0) -#### Breaking Changes +#### Breaking changes - `OmnifactotumArrayExtensions`: Removed `ToHexString(this byte[], bool)` and `ToHexString(this byte[])` in favor of `ToHexString(this byte[] bytes, string? separator = null, bool upperCase = false)` @@ -61,9 +95,11 @@ - `string ToString()`: Changed the result format from `[Lower; Upper]` to `[Lower ~ Upper]` - `ValueRangeConstraintBase`: Included invalid value in the error message +--- + ### Changes in 0.15.0 (since 0.14.1) -#### Breaking Changes +#### Breaking changes - `ObjectValidator.Validate()` method: Added `instanceExpression` parameter - For .NET 5+ and higher, the `instanceExpression` parameter is marked with the `CallerArgumentExpression` attribute @@ -87,6 +123,8 @@ - Applied `MeansImplicitUse` annotations to `TKeyConstraint` and `TValueConstraint` in `KeyValuePairConstraint` +--- + ### Changes in 0.14.1 (since 0.14.0) #### Minor updates and fixes @@ -100,7 +138,7 @@ ### Changes in 0.14.0 (since 0.13.0) -#### Breaking Changes +#### Breaking changes - Dropped support of **.NET Framework 4.7.2** and **.NET Standard 2.0** - **.NET 7+**: Removed the following extension methods since the analogous ones are available since .NET 7: @@ -117,7 +155,7 @@ ### Changes in 0.13.0 (since 0.12.0) -#### Breaking Changes +#### Breaking changes - `OmnifactotumEnumExtensions`: `EnsureDefined(this TEnum ...)` now returns the input value instead of `void` - `TemplatedStringResolver`: `GetVariableNames()` now returns `HashSet` instead of `string[]` @@ -135,7 +173,7 @@ ### Changes in 0.12.0 (since 0.11.0) -#### Breaking Changes +#### Breaking changes - Removed support of **.NET Framework 4.6.1** @@ -155,7 +193,7 @@ ### Changes in 0.11.0 (since 0.10.0) -#### Breaking Changes +#### Breaking changes - `OmnifactotumEnumExtensions`: Added the `enumerationValueExpression` parameter to the `CreateEnumValueNotImplementedException()` and `CreateEnumValueNotSupportedException()` methods: - For .NET 5+ and higher, the `enumerationValueExpression` parameter is marked with the `CallerArgumentExpression` attribute @@ -234,7 +272,7 @@ ### Changes in 0.9.0 (since 0.8.0) -#### Breaking Changes +#### Breaking changes - `ByReferenceEqualityComparer` class: Enforced the `class` constraint on `T` - `DirectedGraphNode`: Removed the parameterless constructor overload and applied the corresponding default value in the remaining constructor @@ -354,7 +392,7 @@ ### Changes in 0.7.0 (since 0.6.0) -#### Breaking Changes +#### Breaking changes - **Removed** support of **.NET Framework 4.0** - `OmnifactotumGenericObjectExtensions`: Removed the `Morph()` methods (null propagation can be used instead) @@ -407,306 +445,3 @@ - Improvements in `OmnifactotumDictionaryExtensions`: - Using Nullable Reference Types (where applicable) - Applied `AggressiveInlining` (where applicable) - ---- - -### Changes in 0.6.0 (since 0.5.0) - -#### Breaking Changes - -- `OmnifactotumArrayExtensions` - - `Initialize()` overloads now return the passed array instead of `void` -- Enforced the `Enum` constraint on the applicable generic types and methods - - `EnumFactotum` methods: - - `GetValue()` - - `GetValue()` - - `GetAllValues()` - - `GetAllFlagValues()` - - `EnumFixedSizeDictionary` class - - `EnumFixedSizeDictionaryDeterminant` class - - `OmnifactotumEnumExtensions` methods: - - `IsAllSet()` - - `IsAnySet()` - - `IsOneOf()` - -#### Deprecations - -- Object validation - - Deprecated `NotNullOrWhiteSpaceStringConstraint` in favor of the newly - added `NotBlankStringConstraint` - -#### New features - -- Types - - Added delegate `Task EventHandlerAsync<>(...)` (excluding .NET Framework 4.0) - - Added `OutFunc<...>` delegates (similar to `System.Func<>`, but having an `out` parameter of the type `TOutput`) - - `OutFunc` - - `OutFunc` - - `OutFunc` - - `OutFunc` - - Added `SemaphoreSlimBasedLock` - - Object validation: - - Added `NotBlankStringConstraint` - - Added `NotNullOrEmptyCollectionConstraint` - - Added `NotNullOrEmptyCollectionConstraint` - - Added `WebUrlConstraint` -- Extension Methods - - Added `EventHandlerAsyncExtensions` (extension methods for `EventHandlerAsync<>`) (excluding .NET Framework 4.0) - - `OmnifactotumArrayExtensions` - - Using Nullable Reference Types (where applicable) - - Added `Initialize(T[], T)` (initializing with a specific constant value) - - Updated `OmnifactotumCollectionExtensions` - - Added `DoForEachAsync` - - Using Nullable Reference Types for all the methods (where applicable). Particularly: - - `GetFastCount` - - `CollectionsEquivalent` - - `CollectionsEqual` - - `FindDuplicates` - - `DisposeCollectionItemsSafely` - - `AvoidNull` - - `ToHashSet` - - `ToUIString` - - Updated `OmnifactotumDateTimeExtensions` - - Added `EnsureKind()`, `EnsureUtc()`, and `EnsureLocal()` methods - - Added `ToFixedStringWithMilliseconds()` method - - Exposed `FixedStringFormat`, `FixedStringWithMillisecondsFormat`, and `PreciseFixedStringFormat` fields - - Updated `OmnifactotumDateTimeOffsetExtensions` - - Added `ToFixedStringWithMilliseconds()` method - - Exposed `FixedStringFormat`, `FixedStringWithMillisecondsFormat`, and `PreciseFixedStringFormat` fields - - Added `OmnifactotumDelegateExtensions` (extension methods for delegates) with method: - - `GetTypedInvocations()` - - Added `OmnifactotumEqualityComparerExtensions` (extension methods for `IEqualityComparer`) with method: - - `GetHashCodeSafely(this IEqualityComparer, ...)` - - Updated `OmnifactotumGenericObjectExtensions`: - - Added `GetObjectReferenceDescription()` - - Added `GetShortObjectReferenceDescription()` - - Added `AsNullable` (`where T : struct`) - - Applied `NotNullIfNotNull` annotation on `EnsureNotNull()` (.NET Standard 2.1+ and .NET 5.0+ only) - - Using Nullable Reference Types (where applicable). Particularly: - - `ToStringSafely()` - - `ToStringSafelyInvariant()` - - `GetHashCodeSafely()` - - `GetTypeSafely()` - - `ToUIString()` - - `ToPropertyString()` - - `IsEqualByContentsTo()` - - `Morph()` - - Added `OmnifactotumHttpStatusCodeExtensions` with method: - - `ToUIString(HttpStatusCode)` - - Added `OmnifactotumNullableDateTimeExtensions` with methods: - - `ToFixedString()` - - `ToFixedStringWithMilliseconds()` - - `ToPreciseFixedString()` - - Added `OmnifactotumNullableDateTimeOffsetExtensions` with methods: - - `ToFixedString()` - - `ToFixedStringWithMilliseconds()` - - `ToPreciseFixedString()` - - Added `OmnifactotumTaskExtensions` with methods (excluding .NET Framework 4.0): - - `AwaitAllAsync(IEnumerable)` - - `AwaitAllAsync(IEnumerable>)` - - `ConfigureAwaitNoCapturedContext(Task)` - - `ConfigureAwaitNoCapturedContext(Task)` - - Added `OmnifactotumValueTaskExtensions` with methods (excluding .NET Framework 4.0): - - `ConfigureAwaitNoCapturedContext(ValueTask)` - - `ConfigureAwaitNoCapturedContext(ValueTask)` - -#### Minor Updates - -- `OmnifactotumArrayExtensions`: Minor optimization in `AvoidNull()` -- `OmnifactotumGenericObjectExtensions` - - `ToStringSafely()` and `ToStringSafelyInvariant()` now never return `null` and instead fall back to `string.Empty` -- `OmnifactotumStringExtensions`: Fixed annotation in `ToUIString()` -- Applied `MethodImplOptions.AggressiveInlining` (and, when possible, `MethodImplOptions.AggressiveOptimization`) to the methods, where reasonable. Affected classes: - - `OmnifactotumGenericObjectExtensions` - - `OmnifactotumCollectionExtensions` - ---- - -### Changes in 0.5.0 (since 0.4.1) - -#### Breaking Changes - -- `ReadOnlySet` class: - - `IsReadOnly` property now implements `ICollection.IsReadOnly` **explicitly** -- `IValueContainer` moved from the namespace `Omnifactotum` to `Omnifactotum.Abstractions` - -#### New features - -- Added `ICurrentDateTimeProvider`, `CurrentDateTimeProviderExtensions`, and `LocalComputerCurrentDateTimeProvider` -- Added `IElapsedTimeProvider`, `ElapsedTimeProviderExtensions`, and `StopwatchElapsedTimeProvider` -- The `ReadOnlySet` class now implements `IReadOnlySet` (.NET 5+) -- Added new extension methods for `System.String`: - - `IsWebUri(string)` - - `ToSecureString(string)` - - `WithoutTrailingSlash(string)` - - `WithSingleTrailingSlash(string)` -- Added new extension methods for `System.Uri`: - - `IsWebUri(Uri)` - - `ToUIString(Uri)` - - `WithoutTrailingSlash(Uri)` - - `WithSingleTrailingSlash(Uri)` -- Added new extension methods for `System.Security.SecureString`: - - `IsNullOrEmpty(SecureString)` - - `ToPlainText(SecureString)` -- Added `ContractAnnotation` to `OmnifactotumGenericObjectExtensions.EnsureNotNull` -- Improvements in the `OmnifactotumStringExtensions` class: - - Using Nullable Reference Types (where applicable) - - Added the `ContractAnnotation` annotations (where applicable) - - Added the `AggressiveInlining` flag (where applicable) - - Improved parameter annotations (using `NotNullWhen`, `ItemCanBeNull` etc. where applicable) - - Other minor improvements - -#### Minor Updates - -- Polished the XML documentation -- Minor optimizations in the `Factotum` class: - - Applied `MethodImplOptions.AggressiveInlining` where applicable - - Forwarding `CreateEmptyCompletedTask()` to `Task.CompletedTask` (except for NET 4.0) - - Forwarding `CreateEmptyFaultedTask(Exception)` to `Task.FromException(Exception)` (except for NET 4.0) - ---- - -### Changes in 0.4.1 (since 0.4.0) - -- Added the `Factotum.For.Identity` method (same as `Factotum.Identity`) -- Added `Factotum.For.IdentityMethod` (the cached reference to the `Factotum.For.Identity` method) -- Using the `Deterministic` build option -- Using Portable PDBs -- Using `snupkg` format of the symbol package - ---- - -### Changes in 0.4.0 (since 0.3.0.119) - -#### Major Updates - -- `Omnifactotum` is now the multi-target package for: - - .NET Framework 4.0, 4.6.1, and 4.7.2 - - .NET Standard 2.0 and 2.1 - - .NET 5.0 -- Addressed multi-target compatibility issues in: - - `ColoredConsoleTraceListener` - - `OmnifactotumAssemblyExtensions` - - `OmnifactotumCollectionExtensions` - - `OmnifactotumDictionaryExtensions` - - `OmnifactotumOperationContextExtensions` - - `KeyValuePair` (static helper) - - Omnifactotum's `ReadOnlyDictionary` - - `WinEventLog` -- Added `OmnifactotumKeyValuePair` static helper for facilitating migration from .NET Framework to .NET Standard/Core - -#### Breaking Changes - -- `Factotum`: Removed the methods `ToPropertyString` and `AreEqualByContents` in favor of methods `ToPropertyString` and `IsEqualByContentsTo` in `OmnifactotumGenericObjectExtensions` -- `OmnifactotumArrayExtensions`: The method `AsReadOnly()` moved to `OmnifactotumCollectionExtensions` -- `OmnifactotumCustomAttributeProviderExtensions`: Removed the obsolete method `GetCustomAttributes` -- `OmnifactotumGenericObjectExtensions`: Removed the methods `Affirm` and `ComputePredicate` -- `OmnifactotumMathExtensions`: Removed the methods `Sqr(decimal)`, `SqrChecked(float)`, `SqrChecked(double)` since their expected behavior cannot be achieved - -#### New features - -- `OmnifactotumCollectionExtensions`: Added `ToUIString` implementation for collections of strings and collections of nullable value type instances -- `OmnifactotumGenericObjectExtensions`: Implemented `Morph()` overloads for nullable value types (to complement already existing method for the reference types) -- `OmnifactotumNullableBooleanExtensions`: Added an overload of `ToString` accepting value provider delegates -- Added `ReadOnlyItemCollection` (read-only wrapper for `ICollection`) -- Added partial support of Nullable Reference Types: - - `OmnifactotumGenericObjectExtensions.EnsureNotNull` -- Exposed the class `OmnifactotumRepresentationConstants` (formerly `OmnifactotumConstants`) -- Applied `PureAttribute`, `InstantHandleAttribute`, and `NoEnumerationAttribute` annotations in certain appropriate cases - -#### Fixes and improvements - -- Improved documentation -- `KeyedEqualityComparer`: `IEqualityComparer.Equals` and `IEqualityComparer.GetHashCode` now don't throw an exception f an argument is not compatible with the type `T` -- `OmnifactotumAssemblyExtensions` -- `OmnifactotumCollectionHashCodeHelper` (as per the fix in `OmnifactotumHashCodeHelper`) -- `OmnifactotumDateTimeOffsetExtensions` -- `OmnifactotumEnumExtensions`: `GetName`, `GetQualifiedName`, `GetFullName`, `EnsureDefined`, and `IsDefined` -- `OmnifactotumGenericObjectExtensions`: - - `ToUIString()` now uses the invariant culture if the value is `IFormattable` - - Fix in `IsEqualByContentsTo()` for the case of a type with no fields -- `OmnifactotumHashCodeHelper`: Fix in CombineHashCodeValues (for case when the next hash code is zero) -- `OmnifactotumMethodBaseExtensions` -- `OmnifactotumTypeExtensions` -- Updated JetBrains Annotations in `Omnifactotum.Annotations` - ---- - -### Changes in 0.3.0.119 (since 0.3.0.117) -- Omnifactotum: Removed NuGet dependency to the `MSBuildTasks` package since it is only used for development - ---- - -### Changes in 0.3.0.117 (since 0.3.0.114) -- Omnifactotum: `Factotum` and `Factotum.For`: Improved annotations - ---- - -### Changes in 0.3.0.114 (since 0.3.0.101) -- `OmnifactotumAssemblyExtensions`: Improvements -- **BREAKING CHANGE**: `OmnifactotumDisposableExtensions`: `DisposeSafely` now works only for reference and nullable types (2 overloads) -- **BREAKING CHANGE**: `OmnifactotumCollectionExtensions`: `DisposeCollectionItemsSafely` now works only for reference and nullable types (2 overloads) -- **BREAKING CHANGE**: `Factotum`: `DisposeAndNull` now works also for nullable types (besides reference types) -- Introduced the `AsyncFactotum` class with the overloaded methods `ComputeAsync` and `ExecuteAsync` -- Fix in `MemberConstraintBase.CastTo` (and hence in `TypedMemberConstraintBase`) for nullable types -- Improved annotations in Object Validator and related classes -- Minor improvements - ---- - -### Changes in 0.3.0.101 (since 0.3.0.90) -- `KeyedEqualityComparer`: Fixes and improvements -- `KeyedEqualityComparer` static helper class has been introduced -- `Factotum`: `CreateEmptyCompletedTask` and `CreateEmptyFaultedTask` methods have been introduced -- `OmnifactotumGenericObjectExtensions`: `EnsureNotNull` (for nullable) has been introduced -- `IValueContainer` has been introduced for `ValueContainer` and `SyncValueContainer` -- `ValueContainer` and `SyncValueContainer` helper static classes have been introduced -- Improvements and fixes in `OmnifactotumMethodBaseExtensions` and `OmnifactotumTypeExtensions` -- `OmnifactotumStringExtensions`: `TrimSafely`, `TrimStartSafely`, `TrimEndSafely` and `Shorten` methods now never return null - ---- - -### Changes in 0.3.0.90 (since 0.3.0.86) -- **BREAKING CHANGE** `OmnifactotumCustomAttributeProviderExtensions`: `GetCustomAttributes` has been renamed to `GetCustomAttributeArray` (for compatibility with FW 4.5+) - ---- - -### Changes in 0.3.0.86 (since 0.3.0.83) -- **BREAKING CHANGE** `OmnifactotumDictionaryExtensions`: The method `GetValueOrCreate` has been renamed to `GetOrCreateValue` for readability and in order to avoid confusion with `GetValueOrDefault` -- `OmnifactotumDictionaryExtensions`: Improved annotations -- `ValueContainer` and `SyncValueContainer`: - - Support for equality comparison - - Added `DebuggerDisplay` attribute and `ToString()` method -- `OmnifactotumMathExtensions` class has been introduced: - - `Sqr` (square) - - `Sqrt` (square root) - - `Abs` (absolute value) - ---- - -### Changes in 0.3.0.83 (since 0.3.0.82) -- `FixedSizeDictionary`: Improved annotations -- `FixedSizeDictionary`: Implemented version verification in the enumerator - ---- - -### Changes in 0.3.0.82 (since 0.3.0.80) -- `FixedSizeDictionary`: Removed index verification in the internal determinant since this verification highly affected performance - ---- - -### Changes in 0.3.0.80 (since 0.3.0.79) -- `EnumFixedSizeDictionary`: Fix in determining the size - ---- - -### Changes in 0.3.0.79 (since 0.3.0.74) -- `FixedSizeDictionary` and `EnumFixedSizeDictionary` have been introduced. -- Applied Omnifactotum Annotations to the `Factotum` and `OmnifactotumGenericObjectExtensions` classes. - ---- - -### Changes in 0.3.0.74 (since 0.2.0.59) -- **BREAKING CHANGE** Object Validation: Redesign and support of `IEnumerable`. -- **BREAKING CHANGE** Renamed `EnumHelper` to `EnumFactotum`. -- **BREAKING CHANGE** `OmnifactotumExpressionExtensions` is now in the namespace `System.Linq.Expressions` (instead of System). diff --git a/src/Omnifactotum.sln b/src/Omnifactotum.sln index b894216..546a726 100644 --- a/src/Omnifactotum.sln +++ b/src/Omnifactotum.sln @@ -13,6 +13,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common", "Common", "{D7C50C Directory.Build.props = Directory.Build.props ..\LICENSE = ..\LICENSE Omnifactotum.ReleaseNotes.md = Omnifactotum.ReleaseNotes.md + Omnifactotum.ReleaseNotes.UpTo-v0.6.0.md = Omnifactotum.ReleaseNotes.UpTo-v0.6.0.md Omnifactotum.runsettings = Omnifactotum.runsettings Omnifactotum.sln.DotSettings = Omnifactotum.sln.DotSettings Common\Omnifactotum.snk = Common\Omnifactotum.snk @@ -47,4 +48,4 @@ Global GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {7A7FAD81-CE90-4495-AADB-D70E00F23EAD} EndGlobalSection -EndGlobal +EndGlobal \ No newline at end of file