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

The Archive Base Latest Questions

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

I have issue with Include Method , scenario as given Table Warehouse has columns

  • 0

I have issue with Include Method , scenario as given

Table Warehouse has columns

  1. Id–> unique identifier and PK
  2. warehouseNumber–nvarchar(50)

–some more columns

Table WarehouselnkedEcorders

  1. Id–>PK,unique Identifier
  2. warehouseUniqueId–>(FK,Unique Identifier), It has relationship with “Warehouse” table Id column
  3. Status

Warehouse Model has following Code

public class Warehouse
{
    public Warehouse()
    {
        this.WarehouselnkedEcorders = new List<WarehouselnkedEcorder>();
    }
    //Some stuff

    public virtual ICollection<WarehouselnkedEcorder> WarehouselnkedEcorders 
    { get; set; }
}

WarehouselnkedEcOrdeMap has following Code

        // Relationships
        this.HasOptional(t => t.Warehouse)
            .WithMany(t => t.WarehouselnkedEcorders)
            .HasForeignKey(d => d.warehouseUniqueId);

Query

I need to retrive a list of warehouse entity with status=true. I tried the following way,but could not get result. How can I do this?

  List<Warehouse> lstObjWarehouse = objWMSContext.Warehouses.Include("WarehouselnkedEcorders").Where(//o=>SomeCondition)
                                                       .Where(o => SomeCondition)
                                                       .Where(o => o.Deleted == false).ToList();

Here I need to compare value of status=true of each row of “WarehouselnkedEcorder” and it should return result.

  • 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-16T04:17:51+00:00Added an answer on June 16, 2026 at 4:17 am

    Use Any in query:

    List<Warehouse> lstObjWarehouse = db.Warehouses.Include("WarehouselnkedEcorder")
    .Where(o => o.invoicePath == "SomeCondition" 
    && o.Deleted == false 
    && o.WarehouselnkedEcorders.Any(p => p.id == o.id 
    && p.Deleted == false)).ToList();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have some action in my rails application def show @issue = Issue.find(params[:id], :include
Is there some method to issue a screen capture(browser window content only) from the
I have a mongo table that has statistical data like the following.... course_id status
I have an issue where an image resource (Default.png) is included in a build
I have issue with: <form:checkboxes path=roles cssClass=checkbox items=${roleSelections} /> If previous line is used
I have issue that is reproduced on g++. VC++ doesn't meet any problems. So
We are new to ROR, We have issue in creating Login/Logout process in ROR
Share your ideas please! I have issue to check the folder and convert a
Have an issue with marshall and unmarshall readers and writers. So here it is.
I have an issue with jquery and history.back(): I got a link: <a href=#

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.