public static int FindUserIDByEmail(string userEmail, string connectionString) { NpgsqlConnection connection = new Npgsql.NpgsqlConnection(connectionString); connection.Open(); var User = connection.QueryFirstOrDefault <FindUsers>($"SELECT * FROM \"Users\" WHERE \"Email\" = \'{userEmail}\'"); connection.Close(); return(User.UserID); }