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 6645109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:14:46+00:00 2026-05-26T00:14:46+00:00

I have 2 lists I am trying to compare. I execute the following and

  • 0

I have 2 lists I am trying to compare. I execute the following and I get a false value returned:

var areIdentical = list1.SequenceEqual(list2, myFileCompare);

That part is working. My lists are NOT equal. The problem is, I’m using the following command to try to find the differences:

var fileDiff = (from file in list1 
                select file).Except(list2, myFileCompare);

My problem is, fileDiff is returning an empty result set. Since I know they are NOT identical, shouldn’t I get something returned? Perhaps my query is wrong on this. Any help would be appreciated! By the way, I can post more of my code, if you really need it, however, this should suffice.

  • 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-05-26T00:14:46+00:00Added an answer on May 26, 2026 at 12:14 am

    You wouldn’t get anything if:

    • list2 contained everything in list1 but also extra items
    • the ordering was different

    Assuming you don’t care about the ordering, you can use:

    var extraItemsInList2 = list2.Except(list1);
    var extraItemsInList1 = list1.Except(list2);
    

    If you do care about the order, you’ll need to work out exactly how you want the differences to be represented.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 2 equal-length lists and I am trying to get scalar product of
I'm trying to map a Dictionary containing Lists. I have the following set of
lest say I have two lists List1: Tom, Frank, Lacey List2: Frank, Tom what
I have 2 lists that I am trying to compare, sadly they are not
I have two lists that I am trying to compare with < or >
I have three lists of lists, and I'm trying to write a generator function
I'm trying to create a simple, custom, gallery. I have two lists, one with
I have 2 dropdown lists on my webform and using jquery trying to filter/reset
I have been trying to serialize a list that contains arrays and lists. I
I'm trying to find out how I can compare 2 lists of RPMS (Currently

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.