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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:43:47+00:00 2026-05-27T00:43:47+00:00

I have a class Cars and class Models. Car has many properties such as

  • 0

I have a class Cars and class Models. Car has many properties such as CarId and List<Models>. Models has has various properties such as ModelID, Color, Make. I have one list of Cars(coming from end user) call is A and then I have few sets lists of Cars(from DB) call it B . A has one list of Car where as B has multiple lists of Car, I want to compare these two including Models too.

I tried using Except but that does not seem to be working

Sorry for not being clear. lets say
list A has item carId = 1 and property Model has two items 1: ModelId =1, color = black, make = 1999 and items 2: ModelId =3, color = white, make = 2004

list B has 2 items
carId = 5 and Model has two items 1: ModelId =2, color = blue, make = 2000 and items 2: ModelId =3, color = white, make = 2010

carId = 7 and Model has two items 1: ModelId =5, color = black, make = 1999 and items 2: ModelId =9, color = grey, make = 2011

in above example bolded values should be produced by comparer which I will store into new list.
appreciate help.
thanks!

  • 1 1 Answer
  • 1 View
  • 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-27T00:43:48+00:00Added an answer on May 27, 2026 at 12:43 am

    I think you want to implement the IEqualityComparer, to add a custom compare function to your Models class

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

Sidebar

Related Questions

I have a Car class. It has three properties: id, color and model. In
I have two models: cars and pictures in my RoR project class Car <
I have a class: public class CarList { public int quantity{get;set;} public List<Car> Cars
I have a following model: class Car(models.Model): make = models.CharField(max_length=40) mileage_limit = models.IntegerField() mileage
I have these 3 models: class Car < ActiveRecord::Base belongs_to :user has_many :car_styles has_many
I have two model classes: Cars and Customers , Model Cars : class car
I have a car model. (In my database, the cars table has a column
i have 2 models Car and Rating . People rate cars (duhh). I have
I have 2 models: # models/car.rb class Car < ActiveRecord::Base belongs_to :model end and
This is the model: class Car(models.Model): user = models.ForeignKey(User, related_name='cars') name = models.CharField(max_length=64) Url

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.