using API_Access_Control.Models.Entities;
using Microsoft.EntityFrameworkCore;

namespace API_Access_Control.Services;

public class ConsommateurService
{
    private readonly CloudJwtContext _context;

    public ConsommateurService(CloudJwtContext context)
    {
        _context = context;
    }

    public bool Exists(int callerId, string callerSecret)
    {
        return _context.Consommateurs.Any(c => c.ConsommateurPk == callerId && c.ClefSecrete == callerSecret);
    }
}