-
Notifications
You must be signed in to change notification settings - Fork 1
Audit
Arnel Robles edited this page Sep 29, 2026
·
2 revisions
See what a mapping did, or what it would change.
using Mapsicle.Audit;
var result = user.MapWithAudit<UserDto>();
UserDto dto = result.GetValueOrThrow();
IEnumerable<string> missed = result.Audit.UnmappedProperties; // destination members nothing filled
// Map, then compare against what you already have
var detected = request.MapAndDetectChanges(existingDto);
if (detected.HasChanges)
{
foreach (var change in detected.Changes)
{
Console.WriteLine($"{change.PropertyName}: {change.OldValue} to {change.NewValue}");
}
}
// Compare any two instances of one type
List<PropertyChange> diff = before.Diff(after);Diff compares a collection property element by element, so two lists with the same contents in
the same order are not a change. Any other property is compared with Equals, which for a nested
class without its own Equals means by reference: two equal Address instances count as a change.
Mapsicle
Packages
- Core
- Fluent
- EntityFramework
- Validation
- NamingConventions
- Serilog
- Dapper
- AspNetCore
- Json
- Caching
- Audit
- DataAnnotations
Reference