using Blueprint.Core.Entities; using Blueprint.Core.Errors; using Blueprint.Infra.Database; using Blueprint.Infra.Services; using Microsoft.EntityFrameworkCore; using Template.Core.Interfaces.SPI; namespace Template.Infra.Services { public class MySQLUserInfra : MySQLItemInfra, IUserInfra { public MySQLUserInfra(MyDbContext dbContext, ILogger logger) : base(dbContext, logger) { } public async Task GetUserByEmail(string email) { try { return await _dbSet.FirstOrDefaultAsync(p => p.Email == email); } catch (Exception) { _logger.LogError($"Cannot get a user"); throw Errors.CannotQueryError; } } } }