Jeylabs.Comparer 1.0.0

The reusable package will compare a type of different instances according to the property and denote the mismatched properties as a list.

Install-Package Jeylabs.Comparer -Version 1.0.0
dotnet add package Jeylabs.Comparer --version 1.0.0
<PackageReference Include="Jeylabs.Comparer" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Jeylabs.Comparer --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

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; }          


    }
}


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; }          


    }
}


Release Notes

Initial release of the Jeylabs.Comaprer package.

Dependencies

This package has no dependencies.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.0 63 6/20/2019