DeepDiff 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package DeepDiff --version 1.0.0
NuGet\Install-Package DeepDiff -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DeepDiff" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DeepDiff --version 1.0.0
#r "nuget: DeepDiff, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install DeepDiff as a Cake Addin
#addin nuget:?package=DeepDiff&version=1.0.0

// Install DeepDiff as a Cake Tool
#tool nuget:?package=DeepDiff&version=1.0.0

Sample

How do I get started

First configure EntityComparer to know what types you want to compare, in the startup of your application

CompareConfiguration compareConfiguration = new CompareConfiguration();
compareConfiguration.Entity<Entity>()
   .HasKey(x => new { x.StartsOn, x.Name })
   .HasValues(x => new { x.Price, x.Volume })
   .HasMany(x => x.SubEntities)
   .MarkAsInserted(x => x.PersistChange, PersistChange.Insert)
   .MarkAsUpdated(x => x.PersistChange, PersistChange.Update)
   .MarkAsDeleted(x => x.PersistChange, PersistChange.Delete);;
compareConfiguration.PersistEntity<SubEntity>()
   .HasKey(x => x.SubName)
   .HasValues(x => x.Energy)
   .MarkAsInserted(x => x.PersistChange, PersistChange.Insert)
   .MarkAsUpdated(x => x.PersistChange, PersistChange.Update)
   .MarkAsDeleted(x => x.PersistChange, PersistChange.Delete);;
var comparer = compareConfiguration.CreateComparer();

Then in your application code

var results = comparer.Compare(existingEntities, newEntities).ToArray();

Sample entities definition

public class Entity
{
  public Guid Id { get; set; } // DB Key
  public DateTime StartsOn { get; set; } // Business Key
  public string Name { get; set; } // Business Key
  public int Price { get; set; }
  public int Volume { get; set; }
  public PersistChange PersistChange { get; set; }
  public List<SubEntity> SubEntities { get; set; }
}

public class SubEntity
{
  public Guid Id { get; set; } // DB Key
  public string SubName { get; set; } // Business Key
  public int Energy { get; set; }
  public PersistChange PersistChange { get; set; }
}

public enum PersistChange
{
  None,
  Inserted,
  Updated,
  Deleted
}
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net5.0

    • No dependencies.
  • net6.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on DeepDiff:

Package Downloads
DeepDiff.Extensions.Microsoft.DependencyInjection

DeepDeef extensions for Microsft Dependendy Injection

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.8.1 30 6/27/2024
1.8.0 67 6/21/2024
1.7.0 102 4/30/2024
1.6.4 94 4/26/2024
1.6.3 98 3/15/2024
1.6.2 93 2/27/2024
1.6.1 88 2/26/2024
1.6.0 89 2/22/2024
1.5.1 116 2/14/2024
1.5.0 174 1/31/2024
1.4.2 73 1/30/2024
1.4.1 76 1/30/2024
1.4.0 77 1/29/2024
1.3.6 80 1/27/2024
1.3.5 78 1/26/2024
1.3.4 77 1/26/2024
1.3.3 88 1/26/2024
1.3.2 78 1/25/2024
1.3.1 80 1/24/2024
1.3.0 76 1/24/2024
1.2.3 90 1/18/2024
1.2.2 98 1/9/2024
1.2.1 136 12/15/2023
1.1.1 109 12/7/2023
1.1.0 133 12/4/2023
1.0.2 134 12/2/2023
1.0.1 108 12/1/2023
1.0.0 89 12/1/2023