Releases: MADE-Apps/MADE.NET
v3.0.0
Changelog
v3.0.0
Breaking Changes
Target Framework Updates
- All libraries now target
net8.0andnet10.0. Previous target frameworks have been removed.
Newtonsoft.Json Replaced with System.Text.Json
The following libraries have migrated from Newtonsoft.Json to System.Text.Json. All public APIs that previously accepted Newtonsoft.Json.JsonSerializerSettings now accept System.Text.Json.JsonSerializerOptions.
MADE.Web.Mvc
JsonResultconstructor parameter type changed fromJsonSerializerSettingstoJsonSerializerOptions.JsonResult.SerializerOptionsproperty type changed fromJsonSerializerSettingstoJsonSerializerOptions.ControllerBaseExtensions.Json()parameter type changed fromJsonSerializerSettingstoJsonSerializerOptions.
MADE.Web
- All
HttpResponseExtensions.WriteJsonAsync()overloads that acceptedJsonSerializerSettingsnow acceptJsonSerializerOptions.
MADE.Networking
- Internal serialization switched from
Newtonsoft.JsontoSystem.Text.Json. All deserialization usesPropertyNameCaseInsensitive = trueto maintain behavioral compatibility. - No public API signature changes.
MADE.Data.Serialization
JsonTypeMigrationSerializationBinderhas been removed. UseJsonTypeMigrationConverterinstead (see migration guide below).AddTypeMigrationAsynchas been renamed toAddTypeMigrationand is now synchronous (useslockinstead ofSemaphoreSlim).
IEventLogger Methods Changed from void to Task
All 15 methods on IEventLogger (WriteDebug, WriteInfo, WriteWarning, WriteError, WriteCritical and their overloads) now return Task instead of void. Implementations must be updated accordingly.
Timer Moved from MADE.Runtime to MADE.Threading
Timer and ITimer have moved from the MADE.Runtime namespace to MADE.Threading. Update using statements accordingly.
Removed Windows UWP Converters
The obsolete Windows UWP-specific partial classes BooleanToStringValueConverter.Windows.cs and DateTimeToStringValueConverter.Windows.cs (guarded by #if WINDOWS_UWP) have been removed.
Removed Dependencies
| Library | Removed Dependency | Replacement |
|---|---|---|
| MADE.Networking | Newtonsoft.Json |
System.Text.Json (built-in) |
| MADE.Web | Newtonsoft.Json |
System.Text.Json (built-in) |
| MADE.Web.Mvc | Newtonsoft.Json |
System.Text.Json (built-in) |
| MADE.Data.Serialization | Newtonsoft.Json |
System.Text.Json (built-in) |
| MADE.Data.EFCore | Z.EntityFramework.Plus.EFCore |
Custom implementation using Expression trees |
New Features
MADE.Threading
AdaptiveSemaphore- A semaphore that dynamically adjusts its concurrency limit at runtime. SupportsTryShrinkAsync()to reduce andTryGrow()to increase the permit count, bounded by configurable minimum and maximum values.AsyncLazy<T>- Thread-safe lazy initialization for async factories. Supportsawaitdirectly viaGetAwaiter()or explicitly viaGetValueAsync().Debouncer- Delays execution of an action until a configurable quiet period (default 300ms) has elapsed since the last invocation. Supports both sync (Debounce) and async (DebounceAsync) actions.Throttler- Limits execution of an action to at most once per configurable interval (default 300ms). Supports both sync (Throttle) and async (ThrottleAsync) actions.
MADE.Networking
INetworkRequestFactory/NetworkRequestFactory- Factory for creating typed network requests (Get,Post,Put,Patch,Delete,GetStream,PostMultipart). Integrates withIHttpClientFactoryand supports named clients viaWithClient(string clientName).MultipartFormDataPostNetworkRequest- Network request for sending multipart form data, with fluentAddStringContent,AddStreamContent, andAddByteArrayContentmethods.RetryDelegatingHandler- AnHttpMessageHandlerthat retries failed requests with exponential backoff. Configurable max retries (default 3) and initial delay.ServiceCollectionExtensions.AddNetworkRequestFactory()- DI registration forINetworkRequestFactorywith optional namedHttpClientconfiguration.
MADE.Data.Converters
DateTimeToUnixTimestampValueConverter- Converts betweenDateTimeand Unix timestamps (long).StringToEnumValueConverter<TEnum>- Generic converter betweenstringand anyEnumtype, with configurable case sensitivity.FileSizeExtensions.ToHumanReadableFileSize()- Extension methods onlonganddoubleto format byte counts as human-readable strings (e.g., "1.5 MB").TimeSpanExtensions-ToHumanReadableString()for friendly duration formatting andTotalWeeks()for week count.
MADE.Data.EFCore
ISoftDeletable- Interface for entities supporting soft delete, withIsDeletedandDeletedDateproperties.IAuditableEntity- Interface for entities trackingCreatedByandUpdatedBy.SoftDeleteExtensions- Extension methods for applying global soft-delete query filters (ApplySoftDeleteFilter), marking entities as soft-deleted (SoftDelete), restoring them (Restore), and intercepting deletions to convert them to soft deletes (InterceptSoftDeletions).QueryableExtensions.Page()- Pagination extension usingSkip/Take.QueryableExtensions.OrderBy()- Dynamic ordering by property name using Expression trees, replacingZ.EntityFramework.Plus.EFCore.
MADE.Data.Validation
IAsyncValidator- Async counterpart toIValidator, withValidateAsync(object value, CancellationToken).AsyncValidatorCollection- Collection ofIAsyncValidatorinstances with aggregate validation viaValidateAsync(), exposingIsInvalid,IsDirty, andFeedbackMessages.
MADE.Web.Mvc
ForbiddenObjectResult- AnObjectResultthat returns HTTP 403 Forbidden with a response body.
MADE.Testing (New Library)
A new test-framework-agnostic assertion library with fluent Should* extension methods:
BooleanAssertExtensions-ShouldBeTrue(),ShouldBeFalse()ObjectAssertExtensions-ShouldBeNull(),ShouldNotBeNull()StringAssertExtensions-ShouldContain(),ShouldNotContain(),ShouldStartWith(),ShouldEndWith()ComparableAssertExtensions-ShouldBeGreaterThan(),ShouldBeGreaterThanOrEqualTo(),ShouldBeLessThan(),ShouldBeLessThanOrEqualTo()ExceptionAssertExtensions-ShouldThrow<T>(),ShouldThrowAsync<T>(),ShouldNotThrow(),ShouldNotThrowAsync()
Bug Fixes
- Timer.Start dueTime calculation - Fixed
Timer.Start(TimeSpan dueTime)usingdueTime.Milliseconds(the milliseconds component only, 0-999) instead of(int)Math.Ceiling(dueTime.TotalMilliseconds)(the full duration). This caused timers with due times of 1 second or more to use incorrect delays. - Timer.Start not updating DueTime property -
Start(TimeSpan dueTime)andStart(int dueTime)overloads now correctly update theDueTimeproperty before starting the timer.
Migration Guide
Newtonsoft.Json to System.Text.Json
Replace using Newtonsoft.Json with using System.Text.Json and update any JsonSerializerSettings references to JsonSerializerOptions.
// Before (v2)
using Newtonsoft.Json;
var result = controller.Json(value, HttpStatusCode.OK, new JsonSerializerSettings
{
NullValueHandling = NullValueHandling.Ignore
});
// After (v3)
using System.Text.Json;
var result = controller.Json(value, HttpStatusCode.OK, new JsonSerializerOptions
{
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
});JsonTypeMigrationSerializationBinder to JsonTypeMigrationConverter
The Newtonsoft.Json-based JsonTypeMigrationSerializationBinder in the MADE.Data.Serialization.Json.Binders namespace has been replaced with JsonTypeMigrationConverter in the MADE.Data.Serialization.Json.Converters namespace.
// Before (v2)
using MADE.Data.Serialization.Json.Binders;
var binder = new JsonTypeMigrationSerializationBinder();
binder.AddTypeMigration(new JsonTypeMigration("OldAssembly", "OldNamespace.OldType", typeof(NewType)));
var settings = new JsonSerializerSettings
{
TypeNameHandling = TypeNameHandling.All,
SerializationBinder = binder
};
var result = JsonConvert.DeserializeObject<object>(json, settings);
// After (v3)
using MADE.Data.Serialization.Json.Converters;
var converter = new JsonTypeMigrationConverter();
converter.AddTypeMigration(new JsonTypeMigration("OldAssembly", "OldNamespace.OldType", typeof(NewType)));
var options = new JsonSerializerOptions();
options.Converters.Add(converter);
var result = JsonSerializer.Deserialize<object>(json, options);Timer Namespace Change
// Before (v2)
using MADE.Runtime;
// After (v3)
using MADE.Threading;Code Quality Improvements
- File-scoped namespaces: All source files converted to file-scoped namespace declarations.
- ConfigureAwait(false): Added to all
awaitexpressions in library code to prevent deadlocks in synchronization-context-bound environments. - ArgumentNullException.ThrowIfNull: Replaced manual null-check-and-throw patterns with
ArgumentNullException.ThrowIfNull(). - Nullable reference type annotations: Added
?annotations to parameters, return types, fields, and properties that accept or returnnull. - Async correctness:
FileEventLoggerandAppDiagnosticsrewritten for proper async patterns, removingasync voidmethods. - Comprehensive .editorconfig: Added modern .NET analysis rules including CA2007, CA1822, CA1849, and async naming conventions.
v2.0.0
What's Changed
This release brings support for .NET 7 & 8, as well as significant increments to package dependencies.
Support for Xamarin specific application code has been removed in this version. UWP support increases to a minimum of the last stable release of Windows 10.
- Updated minor version for dependencies by @jamesmcroft in #253
- Updated NuGet packages to latest versions by @jamesmcroft in #259
- Updated dependencies by @jamesmcroft in #263
- Updated NuGet packages by @jamesmcroft in #272
- 🧹 Code cleanup by @jamesmcroft in #274
- Added support for generic ID for EF entity by @jamesmcroft in #275
- Bump FluentValidation from 11.2.0 to 11.2.1 by @dependabot in #276
- Create codeql-analysis.yml by @jamesmcroft in #269
- Spruce up NuGet packages with README files by @jamesmcroft in #277
- Bump Microsoft.NET.Test.Sdk from 17.3.0 to 17.3.1 by @dependabot in #278
- ⬆️ Updated dependencies by @jamesmcroft in #288
- Bump Newtonsoft.Json from 13.0.1 to 13.0.2 by @dependabot in #302
- Bump Shouldly from 4.1.0 to 4.2.1 by @dependabot in #336
- Bump FluentValidation from 11.2.2 to 11.5.2 by @dependabot in #331
- Bump NUnit3TestAdapter from 4.2.1 to 4.5.0 by @dependabot in #343
- Upgrade to support .NET 7 & 8 by @jamesmcroft in #346
- Bump minimatch from 3.0.4 to 3.1.2 in /docs by @dependabot in #297
Full Changelog: v1.6.0...v2.0.0
v1.7.0-preview1
What's Changed
- Updated NuGet packages by @jamesmcroft
- 🧹 Code cleanup by @jamesmcroft in #274
- Added support for generic ID for EF entity by @jamesmcroft in #275
- Bump FluentValidation from 11.2.0 to 11.2.1 by @dependabot in #276
- Create codeql-analysis.yml by @jamesmcroft in #269
- Spruce up NuGet packages with README files by @jamesmcroft in #277
Full Changelog: v1.6.0...v1.7.0-preview1
v1.6.0
Collections
- Added
SortandSortDescendingextensions forObservableCollectioninstances - Added
IsNullOrEmptyvalidation extension forIEnumerableinstances - Added
GetValueOrDefaultextension forDictionaryinstances - Removed UWP as target framework (no longer required)
Data Converters
- Added
ToFormattedStringextension tobooland nullableboolinstances - Added
ToDelimitedStringextension forIEnumerableobjects with custom string delimiter option - Added
ToMetersandToMilesconversion extensions fordoubleinstances - Modified the
BooleanToStringValueConverterto extract non-platform specific logic out to be used cross-platforms - Marked the UWP specific value converters as obsolete and target the
UI.Data.Converterslibrary
Data Entity Framework
- Added
Pageand column name basedOrderByextensions for Entity FrameworkQueryableobjects to ease the implementation of paginated requests - Updated EF Core and EF Core Plus packages to latest versions
Data Serialization
- Added
Data.Serializationlibrary with a service for handling type migrations within JSON files saved with Type information contained within it
Data Validation
- Added
IValidationCollectioninterface that can be used to create custom validation collection solution and updated theValidatorCollectionimplementation to support this - Added
Base64Validatorto ensure a value is a valid bas64 string - Added
GuidValidatorto ensure a value can be parsed as a GUID - Added
LongitudeValidatorandLatitudeValidatorto ensure a value is within the expected ranges for lat and long - Added
MacAddressValidatorto ensure a value is a valid MAC address using the .NETPhysicalAddressparser - Added
PredicateValidatorto provide a mechanism to validate objects based on custom validation logic for it - Added
WellFormedUrlValidatorto ensure a value is considered a well-formed URL (https/http/ftp/etc.) - Updated
BetweenValidatorto includeInclusiveflag to customize the min/max range of validity - Updated the
Validatemethod to virtual to allow custom pre or post validation logic for custom built regular expression validators - Removed UWP as target framework (no longer required)
Data Validation for Fluent Validation
- Added
Data.Validation.FluentValidationlibrary that builds on the existing Validation library to allow FluentValidation to be used as a target for validating in the UI using theInputValidatorcomponent for Uno Platform
Runtime
- Added
GetPropertyNamesextension forobjectinstances to get all the property names from the specified object as a list of strings
What's Changed
- Added FluentValidation support for validators by @jamesmcroft in #233
- Added IValidator support to constructor for FluentValidatorCollection by @jamesmcroft in #234
- Removed MADE.Media.Image by @jamesmcroft in #235
- Bump FluentValidation from 10.4.0 to 11.0.0 by @dependabot in #236
- Added pagination and ordering extensions for EF queries by @jamesmcroft in #237
- Updated NuGet packages by @jamesmcroft in #243
- Updated packages by @jamesmcroft in #246
- #247 - Added JSON.NET Type migration binder by @jamesmcroft in #248
- Added collection of new data validators by @jamesmcroft in #249
- Alteration to mark Windows specifics as Obsolete by @jamesmcroft in #250
- Port of usable components from personal archived projects by @jamesmcroft in #251
Full Changelog: v1.5.0...v1.6.0
v1.6.0-preview2
What's Changed
- Added IValidator support to constructor for FluentValidatorCollection by @jamesmcroft in #234
- Removed MADE.Media.Image by @jamesmcroft in #235
Full Changelog: v1.6.0-preview1...v1.6.0-preview2
v1.6.0-preview1
What's Changed
Added validation support for FluentValidation, and providing the framework to build out for other validation frameworks.
To be tested with MADE for Uno Platform.
- Added FluentValidation support for validators by @jamesmcroft in #233
Full Changelog: v1.5.0...v1.6.0-preview1
v1.5.0
- Added
AddIf,AddRangeIf,RemoveIf,RemoveRangeIfconditional collection extensions - Added
Shufflecollection extension for randomly sorting an enumerable - Added
ToDaySuffixdate extension to provide the st, nd, rd, or th day suffix - Added
Truncatestring extension for shortening a value with an ellipsis suffix (...) - Added to/from Base 64 string conversion extensions and value converter
- Updated
EntityBaseconfiguration to support setting up the primary key ID - Added
IsLikestring extension for validating a wildcard LIKE style query against a specified value (e.g. "He*") - Added
JsonResultand controller extensions to support returning the JSON result and internal server error result - Added dependency injection extensions for registering included web services such as the user accessor, and exception handling
- Updated EF NuGet packages to latest versions, supporting .NET 5 & 6 (dropped support for .NET Core 3.1)
- Added extensions for easily enabling API versioning via URL or header
- Migrated out Uno Platform / Windows specific components to MADE-Uno
What's Changed
- Updated Uno to v4 by @jamesmcroft in #199
- Improvements to MADE.NET landing page by @jamesmcroft in #201
- Updated styling for grid bordering system by @jamesmcroft in #202
- Updated getting started docs by @jamesmcroft in #209
- NuGet package update by @jamesmcroft in #210
- Bump MSBuild.Sdk.Extras from 3.0.38 to 3.0.44 by @dependabot in #206
- Bump NUnit3TestAdapter from 4.2.0 to 4.2.1 by @dependabot in #211
- Added API versioning extensions for .NET 5 applications by @jamesmcroft in #212
- Added new issue templates by @jamesmcroft in #220
- Bump coverlet.msbuild from 3.1.0 to 3.1.2 by @dependabot in #216
- Migrating Uno components from MADE.NET by @jamesmcroft in #221
- Updated EF package by @jamesmcroft in #222
- Removed .NET Core 3.1 support for EF Core library by @jamesmcroft in #227
- Bump NUnit from 3.13.2 to 3.13.3 by @dependabot in #228
- Bump minimist from 1.2.5 to 1.2.6 in /docs by @dependabot in #229
- Bump Bogus from 34.0.1 to 34.0.2 by @dependabot in #230
- Added new extensions and helpers across packages by @jamesmcroft in #232
Full Changelog: v1.4.0...v1.5.0
v1.4.0
What's Changed
Introduced .NET 6 support for the Web and Web MVC projects.
- Bump Microsoft.SourceLink.GitHub from 1.0.0 to 1.1.0 by @dependabot in #180
- Bump XPlat.Storage from 1.8.0 to 1.8.1 by @dependabot in #173
- Updated project icon by @jamesmcroft in #181
- Added .NET 6 support by @jamesmcroft in #182
Full Changelog: v1.3.2...v1.4.0
v1.3.2
What's Changed
- Add IEntityBase interface and update concrete class by @pedrolucasmr in #168
- Bump XPlat.Storage from 1.7.20109.1 to 1.8.0 by @dependabot in #170
- Updated project assets by @jamesmcroft in #171
New Contributors
- @pedrolucasmr made their first contribution in #168
Full Changelog: v1.3.1...v1.3.2
Release 1.3.1
Packages available on NuGet
What's Changed 🤔
Bump NuGet packages ☝🏻
NuGet packages have been bumped to newer minor releases. These include:
- Uno [3.9.7 => 3.10.11]
- EF Core (.NET 5) [5.0.9 => 5.0.11]
- EF Core (.NET Core 3.x) [3.1.18 => 3.1.20]
More Information 💭
Full Changelog: 1.3.0...v1.3.1