public async Task <AdminDTO> LoginAdminAsync(string email, string password) { var admin = await _adminRepository.LoginAsync(email, CryptoMethods.HashText(password)); if (admin != null) { return(admin.ProjectedAs <AdminDTO>()); } else { throw new UnauthorizedAccessException(); } }
public async Task <CashierDTO> LoginCashierAsync(string email, string password) { var cashier = await _cashierRepository.LoginAsync(email, CryptoMethods.HashText(password)); if (cashier != null) { return(cashier.ProjectedAs <CashierDTO>()); } else { throw new UnauthorizedAccessException(); } }