Class ObjectComparer
Represents a quick object comparer using the public properties of an object or the public members in a structure.
Inherited Members
Namespace: Swan
Syntax
public static class ObjectComparer
Methods
AreEnumerationsEquals<T>(T, T)
Compare if two enumerables are equal.
Declaration
public static bool AreEnumerationsEquals<T>(T left, T right)
Parameters
| Type | Name | Description |
|---|---|---|
| T | left | The left. |
| T | right | The right. |
Returns
| Type | Description |
|---|---|
| Boolean |
|
Type Parameters
| Name | Description |
|---|---|
| T | The type of enums to compare. |
AreEqual(Object, Object, Type)
Compare if two variables of the same type are equal.
Declaration
public static bool AreEqual(object left, object right, Type targetType)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | left | The left. |
| Object | right | The right. |
| Type | targetType | Type of the target. |
Returns
| Type | Description |
|---|---|
| Boolean |
|
AreEqual<T>(T, T)
Compare if two variables of the same type are equal.
Declaration
public static bool AreEqual<T>(T left, T right)
Parameters
| Type | Name | Description |
|---|---|---|
| T | left | The left. |
| T | right | The right. |
Returns
| Type | Description |
|---|---|
| Boolean |
|
Type Parameters
| Name | Description |
|---|---|
| T | The type of objects to compare. |
AreObjectsEqual(Object, Object, Type)
Compare if two objects of the same type are equal.
Declaration
public static bool AreObjectsEqual(object left, object right, Type targetType)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | left | The left. |
| Object | right | The right. |
| Type | targetType | Type of the target. |
Returns
| Type | Description |
|---|---|
| Boolean |
|
AreObjectsEqual<T>(T, T)
Compare if two objects of the same type are equal.
Declaration
public static bool AreObjectsEqual<T>(T left, T right)
where T : class
Parameters
| Type | Name | Description |
|---|---|---|
| T | left | The left. |
| T | right | The right. |
Returns
| Type | Description |
|---|---|
| Boolean |
|
Type Parameters
| Name | Description |
|---|---|
| T | The type of objects to compare. |
AreStructsEqual(Object, Object, Type)
Compare if two structures of the same type are equal.
Declaration
public static bool AreStructsEqual(object left, object right, Type targetType)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | left | The left. |
| Object | right | The right. |
| Type | targetType | Type of the target. |
Returns
| Type | Description |
|---|---|
| Boolean |
|
AreStructsEqual<T>(T, T)
Compare if two structures of the same type are equal.
Declaration
public static bool AreStructsEqual<T>(T left, T right)
where T : struct
Parameters
| Type | Name | Description |
|---|---|---|
| T | left | The left. |
| T | right | The right. |
Returns
| Type | Description |
|---|---|
| Boolean |
|
Type Parameters
| Name | Description |
|---|---|
| T | The type of structs to compare. |