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

  • Home
  • SEARCH
  • 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 8439881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:07:48+00:00 2026-06-10T08:07:48+00:00

Afternoon, I would like to return a bool if the prices match. I am

  • 0

Afternoon,

I would like to return a bool if the prices match. I am returning 3 different prices, however i need to compare if lowprice and amzprice are the same. If they are i need to also return…

pricematched = true

Below is my current query.

 var query = from a in dc.aProducts
             join t in dc.tProducts on a.sku equals t.sku
             join lp in dc.LowestPrices on a.asin equals lp.productAsin
             orderby t.title
             select new GetLowestPrices
             {
                 productAsin = lp.productAsin,
                 sku = t.sku,
                 title = t.title,
                 oprice = Convert.ToString(t.tPrice),
                 lowprice = Convert.ToString(lp.price),
                 amzprice = Convert.ToString(lp.tAmzPrice),
                 lastupdated = Convert.ToDateTime(lp.priceDate)
            };
            return query.ToList();

all help will be much appreciated, thanks.

  • 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-10T08:07:50+00:00Added an answer on June 10, 2026 at 8:07 am

    If you can add the boolean to your existing object, it just factors into the query like below:

     var query = from a in dc.aProducts
             join t in dc.tProducts on a.sku equals t.sku
             join lp in dc.LowestPrices on a.asin equals lp.productAsin
             orderby t.title
             select new GetLowestPrices
             {
                 productAsin = lp.productAsin,
                 sku = t.sku,
                 title = t.title,
                 oprice = Convert.ToString(t.tPrice),
                 lowprice = Convert.ToString(lp.price),
                 amzprice = Convert.ToString(lp.tAmzPrice),
                 lastupdated = Convert.ToDateTime(lp.priceDate),
                 pricematched = lp.tAmzPrice >= lp.price    // This should do it
            };
            return query.ToList();
    

    Otherwise you’ll have to do it outside the query with a secondary query:

    var matchedItems = query.Where(x => x.amzprice >= x.lowprice);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Afternoon, I would like to know how i can add a class depending on
Afternoon, I would like to know how i would do this query in LINQ,
Afternoon, i would like to perform an ajax call when i close the fancybox
Good afternoon, I would like create a application that can can create folders and
Good afternoon Would just like to know what the easiest way would be of
Good afternoon I would just like to know the easiest way for standard Console
Good afternoon, This may sound like a silly question, but it would be really
Afternoon, How would i set this as not equal to? I am basically trying
Afternoon, I need to split an array into smaller "chunks". I am passing over
Afternoon All, I have a web site where i need to know who is

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.