using LFlow.Base.Interfaces;
using Mapster;
namespace LFlow.Base.Utils;
///
/// 映射器
///
public static class Mapper
{
///
/// 将一个对象映射到另一个对象
///
///
///
///
public static T? Map(object source)
{
if (source == null)
{
return default;
}
return source.Adapt();
}
///
/// 将一个数据模型映射到另一个对象
///
///
///
///
public static T? MapTo(this IDataModel model)
{
if (model == null)
{
return default;
}
return model.Adapt();
}
}