Jeylabs.Comparer
1.0.0
dotnet add package Jeylabs.Comparer --version 1.0.0
NuGet\Install-Package Jeylabs.Comparer -Version 1.0.0
<PackageReference Include="Jeylabs.Comparer" Version="1.0.0" />
paket add Jeylabs.Comparer --version 1.0.0
#r "nuget: Jeylabs.Comparer, 1.0.0"
// Install Jeylabs.Comparer as a Cake Addin #addin nuget:?package=Jeylabs.Comparer&version=1.0.0 // Install Jeylabs.Comparer as a Cake Tool #tool nuget:?package=Jeylabs.Comparer&version=1.0.0
Jeylabs.Comparer (.Net Framework)
The reusable package will compare a type of different instances according to the property and denote the mismatched properties as a list.
Target
The package targets .Net Framework 4.0
or latest. you can install and use the package Jeylabs.Comparer
on projects which are based on .Net Framework
Usage
To start using reusable_timeline you can install it using nuget
If you are using "Nuget Package Manager Console" use the following command to install it
Install-Package Jeylabs.Comparer -Version 1.0.0
If you are using ".NET CLI" use the following command to install it
dotnet add package Jeylabs.Comparer --version 1.0.0
If you are using "Nuget Package Manager (GUI)" follow the steps which following gif showing.
You must use the Jeylabs.Comparer
namespace from the Jeylabs.Comparer
package
using Jeylabs.Comparer;
Then you have to to pass the value to the params of AreEqual
method of Comparer
class
Your Code Look like following Example:
.
using Jeylabs.Comparer;
using System;
namespace PackageTestComparer
{
class Program
{
static void Main(string[] args)
{
A a1 = new A { Id = 2, Name = "Test" }; // Create Instance of class A as Object to Compare
A a2 = new A { Id = 2, Name = "Test1" }; // Create Instance of class A as Object to Compare
string[] ignore = { "b" };// You can ignore the properties wich are not wish to compare
ComparisonResult result = Comparer.AreEqual(a1, a2, ignore); // Call the Method and store the result.
// Note : Here ComparisonResult class is a member of "Jeylabs.Comparer" package it stores the reult of Comparision
// Also result contains List of mismatched parameter Names and status of AreEqual as boolean.
Console.ReadLine();
}
}
public class A
{
public int Id { get; set; }
public string Name { get; set; }
public B b { get; set; }
}
public class B
{
public int Id { get; set; }
public string Name { get; set; }
}
}
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 550 | 6/20/2019 |
Initial release of the Jeylabs.Comaprer package.