Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9323163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T04:16:35+00:00 2026-06-19T04:16:35+00:00

I have such construction List<int[]> propIDs = new List<int[]>(); Can I get all unique

  • 0

I have such construction

List<int[]> propIDs = new List<int[]>();

Can I get all unique value from propIDs with LINQ.For example I have list of
(1,2)
(4,5)
(1,5)
(1,2)
(1,5)
and I must get
(1,2)
(4,5)
(1,5)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T04:16:36+00:00Added an answer on June 19, 2026 at 4:16 am

    Below is a complete and working application of your need.

    using System;
    using System.Collections.Generic;
    using System.Diagnostics;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    
    namespace ListsAndArrays
    {
        class Program
        {
            static void Main(string[] args)
            {
                List<int[]> propIDs = new List<int[]>();
                propIDs.Add(new[] { 1, 2 });
                propIDs.Add(new[] { 4, 5 });
                propIDs.Add(new[] { 1, 5 });
                propIDs.Add(new[] { 1, 2 });
                propIDs.Add(new[] { 1, 5 });
    
                var distinct = propIDs.Distinct(new DistinctIntegerArrayComparer());
    
                foreach (var item in distinct)
                {
                    Console.WriteLine("{0}|{1}", item[0], item[1]);
                }
    
                if (Debugger.IsAttached)
                {
                    Console.ReadLine();
                }
            }
    
            private class DistinctIntegerArrayComparer : IEqualityComparer<int[]>
            {
                public bool Equals(int[] x, int[] y)
                {
                    if (x.Length != y.Length) { return false; }
                    else if (x.Length != 2 || y.Length != 2) { return false; }
    
                    return x[0] == y[0] && x[1] == y[1];
                }
    
                public int GetHashCode(int[] obj)
                {
                    return -1;
                }
            }
    
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say you have two collections of integers: IEnumerable<int> col1=new List<int> {2,3,3,5,7,11,11,11,13}; IEnumerable<int> col2=new
i have such code (copy paste from wiki). Its multiplication of those big numbers
i have such function to solve some logic riddle iloczyny is list with such
I have such a list List<Double[,]> . Let's call each 2-dimensional array in the
I have to exclude one default filter from Spring Security stack. So all filters
I have a Project entity and a Group entity. I can get a Project
I have 2 classes: public class LocalizationEntry { public List<TranslationPair> Translations { get; set;
Say I have a struct defined as such struct Student { int age; int
In .NET, a value type (C# struct ) can't have a constructor with no
I have a constructor for a window in my project setup such that it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.