using AutoMapper;
using IStation.Untity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IStation.Service
{
///
/// ζεΊζε±
///
public static class SorterExtensions
{
///
///
///
///
///
public static List ToEntityList(this IEnumerable models)
{
if (models == null || models.Count() < 1)
return default;
var mapper = new MapperConfiguration(cfg => cfg.CreateMap()
.ForMember(d => d.ParentIds, opt => opt.MapFrom(src => TreeParentIdsHelper.ToString(src.ParentIds)))
).CreateMapper();
var entities = mapper.Map, List>(models.ToList());
return entities;
}
///
///
///
///
///
public static List ToEntityList(this IEnumerable models)
{
if (models == null || models.Count() < 1)
return default;
var mapper = new MapperConfiguration(cfg => cfg.CreateMap()).CreateMapper();
var entities = mapper.Map, List>(models.ToList());
return entities;
}
///
///
///
///
///
public static List ToEntityList(this IEnumerable models)
{
if (models == null || models.Count() < 1)
return default;
var mapper = new MapperConfiguration(cfg => cfg.CreateMap()
.ForMember(d => d.ParentIds, opt => opt.MapFrom(src => TreeParentIdsHelper.ToString(src.ParentIds)))
).CreateMapper();
var entities = mapper.Map, List>(models.ToList());
return entities;
}
///
///
///
///
///
public static List ToEntityList(this IEnumerable models)
{
if (models == null || models.Count() < 1)
return default;
var mapper = new MapperConfiguration(cfg => cfg.CreateMap()).CreateMapper();
var entities = mapper.Map, List>(models.ToList());
return entities;
}
}
}