using System;
using System.Collections.Generic;
using System.Linq;
using Quadarax.Foundation.Core.Data.Interface.Entity;

namespace Quadarax.Foundation.Core.Data.Mapper
{
    /*
    public static class MapperExt
    {
        public static TDto Map<TDao, TDto, TKey>(this TDao dao)
            where TDao : class, IDao<TKey>, new()
            where TDto : class, IDto, new()
            where TKey : IEquatable<TKey>
        {
            if (dao == null) return null;
            return Mapper.Instance.Map<TDao, TDto>(dao);
        }

        public static TDao MapDto<TDto, TDao, TKey>(this TDto dto)
            where TDao : class, IDao<TKey>, new()
            where TDto : class, IDto, new()
            where TKey : IEquatable<TKey>
        {
            if (dto == null) return null;
            return Mapper.Instance.Map<TDto, TDao>(dto);
        }

        public static List<TDto> MapList<TDao, TDto, TKey>(this IQueryable<TDao> dao)
            where TDao : class, IDao<TKey>, new()
            where TDto : class, IDto, new()
            where TKey : IEquatable<TKey>
        {
            if (dao == null) return new List<TDto>();
            return Mapper.Instance.MapList<TDao, TDto>(dao);
        }

        public static List<TDto> MapList<TDao, TDto,TKey>(this IEnumerable<TDao> dao)
            where TDao : class, IDao<TKey>, new()
            where TDto : class, IDto, new()
            where TKey : IEquatable<TKey>
        {
            if (dao == null) return new List<TDto>();
            return Mapper.Instance.MapList<TDao, TDto>(dao);
        }

        public static IQueryable<TDao> MapListDto<TDto,TDao,TKey>(this IEnumerable<TDto> dto)
            where TDao : class, IDao<TKey>, new()
            where TDto : class, IDto, new()
            where TKey : IEquatable<TKey>
        {
            if (dto == null) return new List<TDao>().AsQueryable();
            return Mapper.Instance.MapList<TDto, TDao>(dto.AsQueryable()).AsQueryable();
        }
    }
    */
}