Got at least one data fetching method working; turns out, we can't use a patched LogicStack to get the data
This commit is contained in:
24
Vendor/Swan.Lite-3.1.0/Mappers/ObjectMapper.PropertyInfoComparer.cs
vendored
Normal file
24
Vendor/Swan.Lite-3.1.0/Mappers/ObjectMapper.PropertyInfoComparer.cs
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Swan.Mappers
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an AutoMapper-like object to map from one object type
|
||||
/// to another using defined properties map or using the default behaviour
|
||||
/// to copy same named properties from one object to another.
|
||||
///
|
||||
/// The extension methods like CopyPropertiesTo use the default behaviour.
|
||||
/// </summary>
|
||||
public partial class ObjectMapper
|
||||
{
|
||||
internal class PropertyInfoComparer : IEqualityComparer<PropertyInfo>
|
||||
{
|
||||
public bool Equals(PropertyInfo x, PropertyInfo y)
|
||||
=> x != null && y != null && x.Name == y.Name && x.PropertyType == y.PropertyType;
|
||||
|
||||
public int GetHashCode(PropertyInfo obj)
|
||||
=> obj.Name.GetHashCode() + obj.PropertyType.Name.GetHashCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user