using Silk_Road_Api.DatabaseContext;

namespace Silk_Road_Api.Repositories;

public class RepositoryBase : IRepositoryBase
{
    protected readonly SilkRoadApiContext _context;

    public RepositoryBase(SilkRoadApiContext context)
    {
        _context = context;
    }

    public async Task<T> GetAsync<T>(params object[] ids) where T : class
    {
        return await _context.FindAsync<T>(ids);
    }

    public IQueryable<T> AsQueryable<T>() where T : class
    {
        return _context.Set<T>().AsQueryable();
    }
}
