using LSFE.MobApp.Entities.Location;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace LSFE.MobApp.Contracts
{
    public interface IRepository<T> where T : class, new()
    {
        Task<List<T>> GetAllAsync();
        Task<T> GetByIdAsync(int id);
        Task<List<T>> GetActiveAsync();
        Task<int> SaveAsync(T item);
        Task<int> UpdateAsync(T item);
        Task<int> DeleteAsync(T item);
        Task<int> DeleteAsync(int id);
        Task<int> TruncateAsync();
        Task<List<T>> QueryAsync(string query, params object[] args);
        Task<T> FirstOrDefaultAsync(Expression<Func<T, bool>> predicate);
        Task<List<T>> WhereAsync(Expression<Func<T, bool>> predicate);
    }
}