using AutoMapper;
using Kimuser.Domain;
using Kimuser.Domain.SystemUsers;
using Kimuser.Dto.Items.SystemUsers;
using Kimuser.Dto.Items.Users;
using Kimuser.Dto.Models.SystemUsers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Kimuser.Dto
{
    public static class MappingExtensions
    {
        public static MapperConfiguration MapperConfiguration;

        public static TDestination MapTo<TSource, TDestination>(this TSource source)
        {
            return AutoMapperConfig.Mapper.Map<TSource, TDestination>(source);
        }
        public static TDestination MapTo<TSource, TDestination>(this TSource source, TDestination destination)
        {
            return AutoMapperConfig.Mapper.Map(source, destination);
        }




        #region SystemUser

        public static SelectOptionUserItem ToSelectOptionUserItem(this SystemUser entity)
        {
            return entity.MapTo<SystemUser, SelectOptionUserItem>();
        }
        public static SystemUserItem ToItem(this SystemUser entity)
        {
            return entity.MapTo<SystemUser, SystemUserItem>();
        }

        public static SystemUserLocalItem ToLocalItem(this SystemUser entity)
        {
            return entity.MapTo<SystemUser, SystemUserLocalItem>();
        }

        public static SystemUserModel ToModel(this SystemUser entity)
        {
            return entity.MapTo<SystemUser, SystemUserModel>();
        }

        public static SystemUser ToEntity(this SystemUserModel entity)
        {
            return entity.MapTo<SystemUserModel, SystemUser>();
        }

        #endregion






    }
}
