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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:40:28+00:00 2026-05-12T05:40:28+00:00

In some (or many) ways linqtosql makes its hard to recreate a very easy

  • 0

In some (or many) ways linqtosql makes its hard to recreate a very easy sql. I’ve tried googling but couldn’t find any answer on how to convert to linqtosql the code below with a left outer join that has one condition that should evaluate a column value to true. Thanks in advance to anyone who can help (preferably in c#).

SELECT *
FROM
StockType INNER JOIN StoreProduct ON StockType.StockTypeID = StoreProduct.StockTypeID

LEFT OUTER JOIN Yield ON Yield.ToStockTypeID = StockType.StockTypeID AND StockType.IsWholeFormForSpecies = 1

LEFT OUTER JOIN YieldGrade ON YieldGrade.YieldID = Yield.YieldID AND YieldGrade.SizeGradeCode = ‘B’

  • 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-12T05:40:28+00:00Added an answer on May 12, 2026 at 5:40 am

    An example left outer join using multiple conditions, but not your complete query:

    var query = from s in db.StockType 
        join y in db.Yield on 
            new { s.StockTypeID, s.IsWholeFormForSpecies } 
            equals 
            new { StockTypeID = y.ToStockTypeID, IsWholeFormForSpecies = 1 } 
            into y1
        from y2 in y1.DefaultIfEmpty()
        select new 
        {
            StockType = s,
            Yield = y2
        };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried to update some files to old revision in many ways, but I
Hi i tried many ways to solve this but missing some thing.. I have
I tried installing gtk2hs in many ways but have no luck so far installation
I have tried many ways implementing the below example, but I could not make
TeX/LaTeX is great, I use it in many ways. Some of its advantages are:
There are many ways to design a multilingual application in PHP. Some language file
I've read answers in this question and tried many ways to resolve my issue
I've seen HTML nested within a PHP page written in so many ways... some
I have a data frame with an id column and some (potentially many) columns
Sometimes when some feature requires many different settings, they are written in a cloze

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.