public async Task <bool> IsAuthorized(string gatewayId, string empRef) { if (string.IsNullOrWhiteSpace(gatewayId) || string.IsNullOrWhiteSpace(empRef)) { return(false); } var gatewayUsers = await _gatewayRepository.GetGatewayRecordsForId(gatewayId); return(gatewayUsers.Any(u => u.EmpRef == empRef)); }