using AutoMapper;
using AutoMapper.QueryableExtensions;
using Microsoft.EntityFrameworkCore;

namespace AipGateway.API.Domain.Common.Extensions
{
    public static class MappingExtensions
    {
        //public static Task<PaginatedList<TDestination>> PaginatedListAsync<TDestination>(this IQueryable<TDestination> queryable, int pageNumber, int pageSize, int totalCount, string keyword)
        //    => PaginatedList<TDestination>.CreateAsync(queryable, pageNumber, pageSize, totalCount, keyword);

        //public static Task<PaginatedList<TDestination>> PaginatedListAsync<TDestination>(this IEnumerable<TDestination> queryable, int pageNumber, int pageSize, int totalCount, string keyword)
        //    => PaginatedList<TDestination>.CreateAsync(queryable, pageNumber, pageSize, totalCount, keyword);

        public static Task<List<TDestination>> ProjectToListAsync<TDestination>(this IQueryable queryable, IConfigurationProvider configuration)
            => queryable.ProjectTo<TDestination>(configuration).ToListAsync();
    }

}

