Files
BITKit/Core/AutoMapper/BITMapper.cs
CortexCore 4565ff2e35 1
2023-06-05 16:25:06 +08:00

25 lines
598 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
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));
}
}
}
}