﻿using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using AutoMapper;

namespace RepositoryPattern.Domain.Database
{
    public interface IDbProjection<TSource>
    {
        Task<List<TDestination>> ToListAsync<TDestination>(IConfigurationProvider config);

        Task<TDestination[]> ProjectToArrayAsync<TDestination>(IConfigurationProvider config);

        Task<TDestination> ProjectToSingleOrDefaultAsync<TDestination>(IConfigurationProvider config);

        Task<TDestination> ProjectToSingleAsync<TDestination>(IConfigurationProvider config);

        Task<TDestination> ProjectToFirstOrDefaultAsync<TDestination>(IConfigurationProvider config);

        Task<TDestination> ProjectToFirstAsync<TDestination>(IConfigurationProvider config);

        IQueryable<TDestination> ProjectToQueryable<TDestination>(IConfigurationProvider config);
    }
}