private static Email GetNextEmail(string connectionString, int lockID) { Email result; LoginUser loginUser = new LoginUser(connectionString, -1, -1, null); lock (_staticLock) { result = Emails.GetNextWaiting(loginUser, lockID.ToString()); } return(result); }