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

Jeylabs.ComparerCore (.Net Core)

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 Core 1.0 or latest. you can install and use the package Jeylabs.Comparer on projects which are based on .Net Core

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.ComparerCore -Version 1.0.0
    
  • If you are using ".NET CLI" use the following command to install it

      dotnet add package Jeylabs.ComparerCore --version 1.0.0
    
  • If you are using "Nuget Package Manager (GUI)" follow the steps which following gif showing.

You must use the Jeylabs.ComparerCor namespace from the Jeylabs.ComparerCore package

using Jeylabs.ComparerCore;

Then you have to to pass the value to the params of AreEqual method of Comparer class

Your Code Look like following Example:

.

Jeylabs.ComparerCore;
using System;


namespace PackageTestComparerCore
{
    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.ComparerCore" 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.ComparerCore (.Net Core)

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 Core 1.0 or latest. you can install and use the package Jeylabs.Comparer on projects which are based on .Net Core

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.ComparerCore -Version 1.0.0
    
  • If you are using ".NET CLI" use the following command to install it

      dotnet add package Jeylabs.ComparerCore --version 1.0.0
    
  • If you are using "Nuget Package Manager (GUI)" follow the steps which following gif showing.

You must use the Jeylabs.ComparerCor namespace from the Jeylabs.ComparerCore package

using Jeylabs.ComparerCore;

Then you have to to pass the value to the params of AreEqual method of Comparer class

Your Code Look like following Example:

.

Jeylabs.ComparerCore;
using System;


namespace PackageTestComparerCore
{
    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.ComparerCore" 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. it targets to .NetCore Platform

  • .NETStandard 2.0

    • No dependencies.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.0 65 6/20/2019