using CafeCritic.Context;
using Microsoft.AspNetCore.Mvc;

namespace CafeCritic.Controllers;

public class ValidationController : Controller
{
    private readonly CafeDbContext _db;

    public ValidationController(CafeDbContext db)
    {
        _db = db;
    }

    public bool CheckEmail(string email) => !_db.Users.Any(u => u.Email == email);
    
    public bool CheckCafeTitle(string cafeTitle) => !_db.Cafes.Any(c => c.Title == cafeTitle);
    
}