Files
BITKit/Packages/Runtime~/Core/AutoMapper/BITMapper.cs
CortexCore dfbcd03756 upgrade
2023-06-29 14:57:11 +08:00

18 lines
456 B
C#

namespace BITKit
{
public static class BITMapper
{
public static void Map<T>(T source, T target) where T : class
{
foreach (var info in typeof(T).GetProperties())
{
info.SetValue(source, info.GetValue(target));
}
foreach (var info in typeof(T).GetFields())
{
info.SetValue(source, info.GetValue(target));
}
}
}
}